mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-12-27 17:40:22 +00:00
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 <smokewood@qq.com>
This commit is contained in:
@@ -346,7 +346,7 @@ int dfs_mount(const char *device_name,
|
||||
|
||||
int dfs_umount(const char *specialfile, int flags)
|
||||
{
|
||||
int ret = -RT_ERROR;
|
||||
int ret = -1;
|
||||
char *fullpath = RT_NULL;
|
||||
struct dfs_mnt *mnt = RT_NULL;
|
||||
|
||||
@@ -374,11 +374,13 @@ int dfs_umount(const char *specialfile, int flags)
|
||||
else
|
||||
{
|
||||
LOG_I("the file system is busy!");
|
||||
ret = -EBUSY;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_I("the path:%s is not a mountpoint!", fullpath);
|
||||
ret = -EINVAL;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user