mirror of
https://github.com/apache/nuttx.git
synced 2026-08-20 21:18:23 +00:00
fs: Ensure fs_dupfd2 always return fd2 in the sucessful path
it's wrong to return file_dup2 directly since file_dup2 never return file handle Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com> Change-Id: I943537849c75d83b3d646a6a22f035187d9fd521
This commit is contained in:
parent
351bbad39a
commit
79bd6b4c3f
1 changed files with 7 additions and 1 deletions
|
|
@ -85,5 +85,11 @@ int fs_dupfd2(int fd1, int fd2)
|
|||
|
||||
/* Perform the dup2 operation */
|
||||
|
||||
return file_dup2(filep1, filep2);
|
||||
ret = file_dup2(filep1, filep2);
|
||||
if (ret < 0)
|
||||
{
|
||||
return ret;
|
||||
}
|
||||
|
||||
return fd2;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue