file_vopen: Retry as a directory in case of EISDIR

This allows you to open() a directory without O_DIRECTORY.
This commit is contained in:
YAMAMOTO Takashi 2022-10-19 19:14:12 +09:00 committed by Xiang Xiao
parent aa67e0a0f4
commit 4eee9af668

View File

@ -186,6 +186,11 @@ static int file_vopen(FAR struct file *filep, FAR const char *path,
ret = -ENXIO;
}
if (ret == -EISDIR)
{
ret = dir_allocate(filep, desc.relpath);
}
if (ret < 0)
{
goto errout_with_inode;