You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/05/08 22:17:07 UTC

[GitHub] [incubator-nuttx] Ouss4 commented on a change in pull request #3682: fs: nx_dup2 should return zero(OK) in the sucess

Ouss4 commented on a change in pull request #3682:
URL: https://github.com/apache/incubator-nuttx/pull/3682#discussion_r628802817



##########
File path: fs/inode/fs_files.c
##########
@@ -432,7 +432,7 @@ int nx_dup2(int fd1, int fd2)
                                  [fd2 % CONFIG_NFILE_DESCRIPTORS_PER_BLOCK]);
   _files_semgive(list);
 
-  return ret < 0 ? ret : fd2;
+  return ret;

Review comment:
       The return of `nx_dup2` is used directly in `dup2` and, as mentioned in https://github.com/apache/incubator-nuttx-apps/pull/708, it should be the new file descriptor. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org