Skip to content

Commit 8507c38

Browse files
polarvidRbb666
authored andcommitted
fixup: umount: set errno according to POSIX
According to the POSIX.1, we should give a EBUSY on umount(2) of busy filesystem. Signed-off-by: Shell <[email protected]>
1 parent b63b388 commit 8507c38

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

components/dfs/dfs_v2/src/dfs_fs.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ int dfs_mount(const char *device_name,
346346

347347
int dfs_umount(const char *specialfile, int flags)
348348
{
349-
int ret = -RT_ERROR;
349+
int ret = -1;
350350
char *fullpath = RT_NULL;
351351
struct dfs_mnt *mnt = RT_NULL;
352352

@@ -374,11 +374,13 @@ int dfs_umount(const char *specialfile, int flags)
374374
else
375375
{
376376
LOG_I("the file system is busy!");
377+
ret = -EBUSY;
377378
}
378379
}
379380
else
380381
{
381382
LOG_I("the path:%s is not a mountpoint!", fullpath);
383+
ret = -EINVAL;
382384
}
383385
}
384386
else

0 commit comments

Comments
 (0)