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:47:25 UTC

[GitHub] [incubator-nuttx-apps] davids5 commented on a change in pull request #414: fsutils/ipcfg fixes

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