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:
chenrun1 2024-09-25 19:47:46 +08:00 committed by Xiang Xiao
parent 846cb7d432
commit 58044e3026
1 changed files with 1 additions and 1 deletions

View File

@ -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);
}