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:
Xiang Xiao
2021-01-02 21:55:05 +08:00
parent 79bd6b4c3f
commit 3a0a438d29
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -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
View File
@@ -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
View File
@@ -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;
}