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/03/26 02:31:41 UTC

[incubator-nuttx] branch master updated (3ff956d -> 27aa161)

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


    from 3ff956d  stm32h7: support SDRAM via FMC peripherial (#459)
     new c65bdde  include/nuttx/fs/hostfs.h: Appease nxstyle errors
     new f89ccf8  sim: host_readdir: Ensure NUL termination when truncating d_name
     new 27aa161  sim: hostfs: Stop assuming CONFIG_NAME_MAX=32

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:
 arch/sim/src/Makefile        |  1 +
 arch/sim/src/sim/up_hostfs.c |  3 ++-
 include/nuttx/fs/hostfs.h    | 18 +++++++++---------
 3 files changed, 12 insertions(+), 10 deletions(-)


[incubator-nuttx] 02/03: sim: host_readdir: Ensure NUL termination when truncating d_name

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

commit f89ccf873ec187a4a9b64b7fe52ce1ad563e5335
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Thu Mar 26 09:48:50 2020 +0900

    sim: host_readdir: Ensure NUL termination when truncating d_name
---
 arch/sim/src/sim/up_hostfs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/sim/src/sim/up_hostfs.c b/arch/sim/src/sim/up_hostfs.c
index 32b8726..2eedd9f 100644
--- a/arch/sim/src/sim/up_hostfs.c
+++ b/arch/sim/src/sim/up_hostfs.c
@@ -320,7 +320,8 @@ int host_readdir(void *dirp, struct nuttx_dirent_s *entry)
 
       /* Copy the entry name */
 
-      strncpy(entry->d_name, ent->d_name, sizeof(entry->d_name));
+      strncpy(entry->d_name, ent->d_name, sizeof(entry->d_name) - 1);
+      entry->d_name[sizeof(entry->d_name) - 1] = 0;
 
       /* Map the type */
 


[incubator-nuttx] 01/03: include/nuttx/fs/hostfs.h: Appease nxstyle errors

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

commit c65bdde5acb787e3d0e9e471c3aaa34d9104221a
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Thu Mar 26 10:06:58 2020 +0900

    include/nuttx/fs/hostfs.h: Appease nxstyle errors
---
 include/nuttx/fs/hostfs.h | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/include/nuttx/fs/hostfs.h b/include/nuttx/fs/hostfs.h
index 5b2444d..dd7cb83 100644
--- a/include/nuttx/fs/hostfs.h
+++ b/include/nuttx/fs/hostfs.h
@@ -122,8 +122,8 @@ typedef uint32_t     nuttx_time_t;
 
 struct nuttx_dirent_s
 {
-  uint8_t      d_type;             /* type of file */
-  char         d_name[NUTTX_NAME_MAX+1]; /* filename */
+  uint8_t      d_type;                     /* type of file */
+  char         d_name[NUTTX_NAME_MAX + 1]; /* filename */
 };
 
 /* These must exactly match the definition from include/sys/statfs.h: */
@@ -177,9 +177,9 @@ int           host_dup(int fd);
 int           host_fstat(int fd, struct nuttx_stat_s *buf);
 int           host_ftruncate(int fd, off_t length);
 void         *host_opendir(const char *name);
-int           host_readdir(void* dirp, struct nuttx_dirent_s* entry);
-void          host_rewinddir(void* dirp);
-int           host_closedir(void* dirp);
+int           host_readdir(void *dirp, struct nuttx_dirent_s *entry);
+void          host_rewinddir(void *dirp);
+int           host_closedir(void *dirp);
 int           host_statfs(const char *path, struct nuttx_statfs_s *buf);
 int           host_unlink(const char *pathname);
 int           host_mkdir(const char *pathname, mode_t mode);
@@ -198,9 +198,9 @@ int           host_dup(int fd);
 int           host_fstat(int fd, struct stat *buf);
 int           host_ftruncate(int fd, off_t length);
 void         *host_opendir(const char *name);
-int           host_readdir(void* dirp, struct dirent *entry);
-void          host_rewinddir(void* dirp);
-int           host_closedir(void* dirp);
+int           host_readdir(void *dirp, struct dirent *entry);
+void          host_rewinddir(void *dirp);
+int           host_closedir(void *dirp);
 int           host_statfs(const char *path, struct statfs *buf);
 int           host_unlink(const char *pathname);
 int           host_mkdir(const char *pathname, mode_t mode);


[incubator-nuttx] 03/03: sim: hostfs: Stop assuming CONFIG_NAME_MAX=32

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

commit 27aa16111cc2934cf214ca9e976d0d57f5e02a4f
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Thu Mar 26 10:03:13 2020 +0900

    sim: hostfs: Stop assuming CONFIG_NAME_MAX=32
---
 arch/sim/src/Makefile     | 1 +
 include/nuttx/fs/hostfs.h | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/sim/src/Makefile b/arch/sim/src/Makefile
index 8aced45..a454caf 100644
--- a/arch/sim/src/Makefile
+++ b/arch/sim/src/Makefile
@@ -190,6 +190,7 @@ endif
 ifeq ($(CONFIG_FS_HOSTFS),y)
 ifneq ($(CONFIG_FS_HOSTFS_RPMSG),y)
   HOSTSRCS += up_hostfs.c
+  HOSTCFLAGS += -DCONFIG_NAME_MAX=$(CONFIG_NAME_MAX)
 
 up_hostfs.c: hostfs.h
 
diff --git a/include/nuttx/fs/hostfs.h b/include/nuttx/fs/hostfs.h
index dd7cb83..73f16c9 100644
--- a/include/nuttx/fs/hostfs.h
+++ b/include/nuttx/fs/hostfs.h
@@ -91,7 +91,7 @@
 
 /* Should match definition in include/limits.h */
 
-#define NUTTX_NAME_MAX   32
+#define NUTTX_NAME_MAX   CONFIG_NAME_MAX
 
 #endif /* __SIM__ */