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/05/01 06:28:57 UTC

[GitHub] [incubator-nuttx] yamt opened a new pull request #932: sim: Update hostfs after the recent struct stat timespec changes

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


   Fix it after the following change:
   
       commit bb4458b63f21e2ccbde238a1860b4f75f68b3362
       Author: Ouss4 <ab...@gmail.com>
       Date:   Thu Apr 30 19:05:12 2020 +0100
   
           include/sys/stat.h: Per the POSIX standard, the atime, ctime and mtime field
       s
           have changed their type from time_t to struct timespec.
   
   ## Summary
   
   ## Impact
   
   ## 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] xiaoxiang781216 commented on a change in pull request #932: sim: Update hostfs after the recent struct stat timespec changes

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



##########
File path: arch/sim/src/sim/up_hostfs.c
##########
@@ -97,18 +97,30 @@ static void host_stat_convert(struct stat *hostbuf, struct nuttx_stat_s *buf)
       buf->st_mode |= NUTTX_S_IFSOCK;
     }
 
-  buf->st_dev     = hostbuf->st_dev;
-  buf->st_ino     = hostbuf->st_ino;
-  buf->st_nlink   = hostbuf->st_nlink;
-  buf->st_uid     = hostbuf->st_uid;
-  buf->st_gid     = hostbuf->st_gid;
-  buf->st_rdev    = hostbuf->st_rdev;
-  buf->st_size    = hostbuf->st_size;
-  buf->st_atim    = hostbuf->st_atime;
-  buf->st_mtim    = hostbuf->st_mtime;
-  buf->st_ctim    = hostbuf->st_ctime;
-  buf->st_blksize = hostbuf->st_blksize;
-  buf->st_blocks  = hostbuf->st_blocks;
+  buf->st_dev          = hostbuf->st_dev;
+  buf->st_ino          = hostbuf->st_ino;
+  buf->st_nlink        = hostbuf->st_nlink;
+  buf->st_uid          = hostbuf->st_uid;
+  buf->st_gid          = hostbuf->st_gid;
+  buf->st_rdev         = hostbuf->st_rdev;
+  buf->st_size         = hostbuf->st_size;
+#if defined(__APPLE__)

Review comment:
       Can we add define at the beginning like this:
   ```
   #ifdef __APPLE__
   #  define st_atim st_atimespec
   #  define st_ctim st_ctimespec
   #  define st_mtim st_mtimespec
   #endif
   ```




----------------------------------------------------------------
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 #932: sim: Update hostfs after the recent struct stat timespec changes

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



##########
File path: arch/sim/src/sim/up_hostfs.c
##########
@@ -97,18 +97,30 @@ static void host_stat_convert(struct stat *hostbuf, struct nuttx_stat_s *buf)
       buf->st_mode |= NUTTX_S_IFSOCK;
     }
 
-  buf->st_dev     = hostbuf->st_dev;
-  buf->st_ino     = hostbuf->st_ino;
-  buf->st_nlink   = hostbuf->st_nlink;
-  buf->st_uid     = hostbuf->st_uid;
-  buf->st_gid     = hostbuf->st_gid;
-  buf->st_rdev    = hostbuf->st_rdev;
-  buf->st_size    = hostbuf->st_size;
-  buf->st_atim    = hostbuf->st_atime;
-  buf->st_mtim    = hostbuf->st_mtime;
-  buf->st_ctim    = hostbuf->st_ctime;
-  buf->st_blksize = hostbuf->st_blksize;
-  buf->st_blocks  = hostbuf->st_blocks;
+  buf->st_dev          = hostbuf->st_dev;
+  buf->st_ino          = hostbuf->st_ino;
+  buf->st_nlink        = hostbuf->st_nlink;
+  buf->st_uid          = hostbuf->st_uid;
+  buf->st_gid          = hostbuf->st_gid;
+  buf->st_rdev         = hostbuf->st_rdev;
+  buf->st_size         = hostbuf->st_size;
+#if defined(__APPLE__)

Review comment:
       You are right.




----------------------------------------------------------------
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] yamt commented on a change in pull request #932: sim: Update hostfs after the recent struct stat timespec changes

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



##########
File path: arch/sim/src/sim/up_hostfs.c
##########
@@ -97,18 +97,30 @@ static void host_stat_convert(struct stat *hostbuf, struct nuttx_stat_s *buf)
       buf->st_mode |= NUTTX_S_IFSOCK;
     }
 
-  buf->st_dev     = hostbuf->st_dev;
-  buf->st_ino     = hostbuf->st_ino;
-  buf->st_nlink   = hostbuf->st_nlink;
-  buf->st_uid     = hostbuf->st_uid;
-  buf->st_gid     = hostbuf->st_gid;
-  buf->st_rdev    = hostbuf->st_rdev;
-  buf->st_size    = hostbuf->st_size;
-  buf->st_atim    = hostbuf->st_atime;
-  buf->st_mtim    = hostbuf->st_mtime;
-  buf->st_ctim    = hostbuf->st_ctime;
-  buf->st_blksize = hostbuf->st_blksize;
-  buf->st_blocks  = hostbuf->st_blocks;
+  buf->st_dev          = hostbuf->st_dev;
+  buf->st_ino          = hostbuf->st_ino;
+  buf->st_nlink        = hostbuf->st_nlink;
+  buf->st_uid          = hostbuf->st_uid;
+  buf->st_gid          = hostbuf->st_gid;
+  buf->st_rdev         = hostbuf->st_rdev;
+  buf->st_size         = hostbuf->st_size;
+#if defined(__APPLE__)

Review comment:
       i don't think it works as it would apply to the lvalues (buf->st_atim etc) as well.
   we can rename nuttx fields so that they won't be affected by the macros. but i feel it's uglier.




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