mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 01:05:54 +08: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:
committed by
Abdelatif Guettouche
parent
223dd0dc8f
commit
cfd7390676
+1
-1
@@ -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;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
+1
-1
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user