mirror of
https://github.com/apache/nuttx.git
synced 2026-08-26 20:00:42 +00:00
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:
parent
aa67e0a0f4
commit
4eee9af668
1 changed files with 5 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue