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/01/02 14:04:27 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 opened a new pull request #2639: fs: Let files_allocate return -EMFILE instead ERROR

xiaoxiang781216 opened a new pull request #2639:
URL: https://github.com/apache/incubator-nuttx/pull/2639


   ## Summary
   since the internal function normally return the error code directly
   
   ## Impact
   No real change
   
   ## Testing
   
   


----------------------------------------------------------------
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



[GitHub] [incubator-nuttx] Ouss4 commented on a change in pull request #2639: fs: Let files_allocate return -EMFILE instead ERROR

Posted by GitBox <gi...@apache.org>.
Ouss4 commented on a change in pull request #2639:
URL: https://github.com/apache/incubator-nuttx/pull/2639#discussion_r550981270



##########
File path: fs/vfs/fs_dupfd.c
##########
@@ -73,7 +73,7 @@ int file_dup(FAR struct file *filep, int minfd)
   fd2 = files_allocate(NULL, 0, 0, minfd);
   if (fd2 < 0)
     {
-      return -EMFILE;
+      return fd2;

Review comment:
       Ah right!  Thanks.  I've been looking at my source tree when I asked that.




----------------------------------------------------------------
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



[GitHub] [incubator-nuttx] Ouss4 merged pull request #2639: fs: Let files_allocate return -EMFILE instead ERROR

Posted by GitBox <gi...@apache.org>.
Ouss4 merged pull request #2639:
URL: https://github.com/apache/incubator-nuttx/pull/2639


   


----------------------------------------------------------------
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



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #2639: fs: Let files_allocate return -EMFILE instead ERROR

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #2639:
URL: https://github.com/apache/incubator-nuttx/pull/2639#discussion_r550951057



##########
File path: fs/vfs/fs_dupfd.c
##########
@@ -73,7 +73,7 @@ int file_dup(FAR struct file *filep, int minfd)
   fd2 = files_allocate(NULL, 0, 0, minfd);
   if (fd2 < 0)
     {
-      return -EMFILE;
+      return fd2;

Review comment:
       Yes, see here:
   https://github.com/apache/incubator-nuttx/pull/2639/files#diff-1fafb74ef7557187f97e4ffa7b8d30c3e6edc1df89cc952ecab48fdbe86e637fL334




----------------------------------------------------------------
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



[GitHub] [incubator-nuttx] Ouss4 commented on a change in pull request #2639: fs: Let files_allocate return -EMFILE instead ERROR

Posted by GitBox <gi...@apache.org>.
Ouss4 commented on a change in pull request #2639:
URL: https://github.com/apache/incubator-nuttx/pull/2639#discussion_r550916990



##########
File path: fs/vfs/fs_dupfd.c
##########
@@ -73,7 +73,7 @@ int file_dup(FAR struct file *filep, int minfd)
   fd2 = files_allocate(NULL, 0, 0, minfd);
   if (fd2 < 0)
     {
-      return -EMFILE;
+      return fd2;

Review comment:
       does `files_allocate` return `EMFILE` somehow?
   The return of `file_dup` is the value that we gonna set `errno` to.




----------------------------------------------------------------
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