mirror of
https://github.com/apache/nuttx.git
synced 2026-05-29 04:19:37 +08: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:
committed by
Abdelatif Guettouche
parent
63bc3efd25
commit
14a3c35917
+7
-1
@@ -85,5 +85,11 @@ int fs_dupfd2(int fd1, int fd2)
|
|||||||
|
|
||||||
/* Perform the dup2 operation */
|
/* Perform the dup2 operation */
|
||||||
|
|
||||||
return file_dup2(filep1, filep2);
|
ret = file_dup2(filep1, filep2);
|
||||||
|
if (ret < 0)
|
||||||
|
{
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
return fd2;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user