You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by gn...@apache.org on 2020/09/30 20:09:28 UTC

[incubator-nuttx-apps] branch master updated (39a1950 -> ff866b9)

This is an automated email from the ASF dual-hosted git repository.

gnutt pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git.


    from 39a1950  wgetjson: Fix a super confusing printf message
     new 16dc854  fsutils:ipcfg Add  extern 'C' under cpp
     new 17c34df  fsutils:ipcfg Fix range checking for PRTOCOL in bin mode
     new ff866b9  fsutils:ipcfg Fix fd propagation as return value in bin mode

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 fsutils/ipcfg/ipcfg.c   |  9 +++++----
 include/fsutils/ipcfg.h | 11 +++++++++++
 2 files changed, 16 insertions(+), 4 deletions(-)


[incubator-nuttx-apps] 03/03: fsutils:ipcfg Fix fd propagation as return value in bin mode

Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gnutt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit ff866b95272c7ad39e34658b16495567c4befff4
Author: David Sidrane <Da...@NscDg.com>
AuthorDate: Wed Sep 30 12:11:56 2020 -0700

    fsutils:ipcfg Fix fd propagation as return value in bin mode
    
       With CONFIG_IPCFG_BINARY lit. ipcfg_open needs to return
       the fd or an -errno. It was returning OK not the fd.
---
 fsutils/ipcfg/ipcfg.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/fsutils/ipcfg/ipcfg.c b/fsutils/ipcfg/ipcfg.c
index e6763b4..b809dd7 100644
--- a/fsutils/ipcfg/ipcfg.c
+++ b/fsutils/ipcfg/ipcfg.c
@@ -201,8 +201,6 @@ static int ipcfg_open(FAR const char *netdev, int oflags, mode_t mode)
   /* Now open the file */
 
   fd  = open(path, oflags, mode);
-  ret = OK;
-
   if (fd < 0)
     {
       ret = -errno;
@@ -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;
 
 errout_with_path:
   free(path);


[incubator-nuttx-apps] 01/03: fsutils:ipcfg Add extern 'C' under cpp

Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gnutt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit 16dc85417b04b4b4ffe8a5e151c35f6fc2fe286f
Author: David Sidrane <Da...@NscDg.com>
AuthorDate: Wed Sep 30 12:08:45 2020 -0700

    fsutils:ipcfg Add  extern 'C' under cpp
---
 include/fsutils/ipcfg.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/include/fsutils/ipcfg.h b/include/fsutils/ipcfg.h
index e594871..5cbb140 100644
--- a/include/fsutils/ipcfg.h
+++ b/include/fsutils/ipcfg.h
@@ -92,6 +92,13 @@ struct ipcfg_s
 /****************************************************************************
  * Public Function Prototypes
  ****************************************************************************/
+#ifdef __cplusplus
+#define EXTERN extern "C"
+extern "C"
+{
+#else
+#define EXTERN extern
+#endif
 
 /****************************************************************************
  * Name: ipcfg_read
@@ -132,5 +139,9 @@ int ipcfg_read(FAR const char *netdev, FAR struct ipcfg_s *ipcfg);
 #ifdef CONFIG_IPCFG_WRITABLE
 int ipcfg_write(FAR const char *netdev, FAR const struct ipcfg_s *ipcfg);
 #endif
+#undef EXTERN
+#ifdef __cplusplus
+}
+#endif
 
 #endif /* __APPS_INCLUDE_FSUTILS_IPCFG_H */


[incubator-nuttx-apps] 02/03: fsutils:ipcfg Fix range checking for PRTOCOL in bin mode

Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gnutt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit 17c34df3b944f65cbc3d1071e61b245f363621bf
Author: David Sidrane <Da...@NscDg.com>
AuthorDate: Wed Sep 30 12:10:09 2020 -0700

    fsutils:ipcfg Fix range checking for PRTOCOL in bin mode
---
 fsutils/ipcfg/ipcfg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fsutils/ipcfg/ipcfg.c b/fsutils/ipcfg/ipcfg.c
index 43a1842..e6763b4 100644
--- a/fsutils/ipcfg/ipcfg.c
+++ b/fsutils/ipcfg/ipcfg.c
@@ -551,7 +551,7 @@ int ipcfg_write(FAR const char *netdev, FAR const struct ipcfg_s *ipcfg)
 
   /* Format and write the file */
 
-  if ((unsigned)ipcfg->proto == MAX_BOOTPROTO)
+  if ((unsigned)ipcfg->proto > MAX_BOOTPROTO)
     {
       fprintf(stderr, "ERROR: Unrecognized BOOTPROTO value: %d\n",
               ipcfg->proto);