mirror of
https://github.com/apache/nuttx.git
synced 2026-08-20 21:18:23 +00:00
fs: Let files_allocate return -EMFILE instead ERROR
since the internal function normally return the error code directly Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com> Change-Id: Ifccbcfb07d2f8f7d5fef1b2a867538f51b73655c
This commit is contained in:
parent
79bd6b4c3f
commit
3a0a438d29
3 changed files with 3 additions and 3 deletions
|
|
@ -336,7 +336,7 @@ int files_allocate(FAR struct inode *inode, int oflags, off_t pos, int minfd)
|
|||
}
|
||||
|
||||
_files_semgive(list);
|
||||
return ERROR;
|
||||
return -EMFILE;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ int file_dup(FAR struct file *filep, int minfd)
|
|||
fd2 = files_allocate(NULL, 0, 0, minfd);
|
||||
if (fd2 < 0)
|
||||
{
|
||||
return -EMFILE;
|
||||
return fd2;
|
||||
}
|
||||
|
||||
ret = fs_getfilep(fd2, &filep2);
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@ int nx_vopen(FAR const char *path, int oflags, va_list ap)
|
|||
fd = files_allocate(inode, oflags, 0, 0);
|
||||
if (fd < 0)
|
||||
{
|
||||
ret = -EMFILE;
|
||||
ret = fd;
|
||||
goto errout_with_inode;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue