mirror of
https://github.com/apache/nuttx.git
synced 2026-05-24 16:11:56 +08:00
fs_open:Adjust the definition of the open path
Summary: Reference https://man7.org/linux/man-pages/man2/open.2.html EISDIR pathname refers to a directory and the access requested involved writing (that is, O_WRONLY or O_RDWR is set). Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
This commit is contained in:
+1
-1
@@ -258,7 +258,7 @@ static int file_vopen(FAR struct file *filep, FAR const char *path,
|
||||
ret = -ENXIO;
|
||||
}
|
||||
|
||||
if (ret == -EISDIR)
|
||||
if (ret == -EISDIR && ((oflags & O_WRONLY) == 0))
|
||||
{
|
||||
ret = dir_allocate(filep, desc.relpath);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user