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:
Shell
2024-11-18 17:16:11 +08:00
committed by Rbb666
parent b63b388d1f
commit 8507c38222

View File

@@ -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