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:
parent
846cb7d432
commit
58044e3026
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue