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 2020/09/30 19:21:08 UTC

[GitHub] [incubator-nuttx-apps] davids5 opened a new pull request #414: fsutils/ipcfg fixes

davids5 opened a new pull request #414:
URL: https://github.com/apache/incubator-nuttx-apps/pull/414


   ## Summary
   
   1. fsutils:ipcfg Add extern 'C' under cpp
   2. fsutils:ipcfg Fix range checking for PRTOCOL in bin mode
   3. fsutils:ipcfg Fix fd propagation as return value in bin mode 
   
   ## Impact
   Fixes use with C++
   Fixes use with CONFIG_IPCFG_BINARY set
   
   ## Testing
   px4_fmuv5x 
   


----------------------------------------------------------------
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-apps] davids5 commented on a change in pull request #414: fsutils/ipcfg fixes

Posted by GitBox <gi...@apache.org>.
davids5 commented on a change in pull request #414:
URL: https://github.com/apache/incubator-nuttx-apps/pull/414#discussion_r497759329



##########
File path: fsutils/ipcfg/ipcfg.c
##########
@@ -220,11 +218,14 @@ static int ipcfg_open(FAR const char *netdev, int oflags, mode_t mode)
   if (ret < 0)
     {
       ret = -errno;
+      close(fd);
       fprintf(stderr, "ERROR: Failed to seek to $ld: %d\n",
               (long)CONFIG_IPCFG_OFFSET, ret);
-      close(fd);
+      goto errout_with_path;
     }
+
 #endif
+  ret = fd;
 

Review comment:
       No. It's a bug.
   Valid fd is 3 but code returns 0 (OK)
   ![image](https://user-images.githubusercontent.com/1945821/94732312-f3d83d00-031a-11eb-9453-df9321c1e133.png)
   




----------------------------------------------------------------
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-apps] patacongo merged pull request #414: fsutils/ipcfg fixes

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


   


----------------------------------------------------------------
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-apps] patacongo commented on a change in pull request #414: fsutils/ipcfg fixes

Posted by GitBox <gi...@apache.org>.
patacongo commented on a change in pull request #414:
URL: https://github.com/apache/incubator-nuttx-apps/pull/414#discussion_r497753919



##########
File path: fsutils/ipcfg/ipcfg.c
##########
@@ -220,11 +218,14 @@ static int ipcfg_open(FAR const char *netdev, int oflags, mode_t mode)
   if (ret < 0)
     {
       ret = -errno;
+      close(fd);
       fprintf(stderr, "ERROR: Failed to seek to $ld: %d\n",
               (long)CONFIG_IPCFG_OFFSET, ret);
-      close(fd);
+      goto errout_with_path;
     }
+
 #endif
+  ret = fd;
 

Review comment:
       I don't see any logic difference with this change.  What is the problem that you are solving?  Or is this just NIH?




----------------------------------------------------------------
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-apps] patacongo commented on a change in pull request #414: fsutils/ipcfg fixes

Posted by GitBox <gi...@apache.org>.
patacongo commented on a change in pull request #414:
URL: https://github.com/apache/incubator-nuttx-apps/pull/414#discussion_r497756163



##########
File path: fsutils/ipcfg/ipcfg.c
##########
@@ -220,11 +218,14 @@ static int ipcfg_open(FAR const char *netdev, int oflags, mode_t mode)
   if (ret < 0)
     {
       ret = -errno;
+      close(fd);
       fprintf(stderr, "ERROR: Failed to seek to $ld: %d\n",
               (long)CONFIG_IPCFG_OFFSET, ret);
-      close(fd);
+      goto errout_with_path;
     }
+
 #endif
+  ret = fd;
 

Review comment:
       Never mind.  It is clearer looking at the whole file.




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