fs: mkdir return EEXIST if the path already exist
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com> Change-Id: Ie1808697b860974367c17e0ba614ca5cae79f324
This commit is contained in:
parent
7053707e0a
commit
02a6966ad5
@ -79,6 +79,12 @@ int mkdir(const char *pathname, mode_t mode)
|
||||
inode = desc.node;
|
||||
DEBUGASSERT(inode != NULL);
|
||||
|
||||
if (desc.relpath[0] == '\0')
|
||||
{
|
||||
errcode = EEXIST;
|
||||
goto errout_with_inode;
|
||||
}
|
||||
|
||||
#ifndef CONFIG_DISABLE_MOUNTPOINT
|
||||
/* Check if the inode is a valid mountpoint. */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user