One more adaptation of module 'stat-time' for the 'struct stat'
with 'struct timespec' fields on Windows:


2017-05-14  Bruno Haible  <br...@clisp.org>

        stat-time: Adapt for windows-stat-timespec.
        * lib/stat-time.h (get_stat_birthtime) [_GL_WINDOWS_STAT_TIMESPEC]: Use
        entire st_ctim field.

diff --git a/lib/stat-time.h b/lib/stat-time.h
index 88dcc7f..9e45e85 100644
--- a/lib/stat-time.h
+++ b/lib/stat-time.h
@@ -170,8 +170,12 @@ get_stat_birthtime (struct stat const *st)
   /* Native Windows platforms (but not Cygwin) put the "file creation
      time" in st_ctime (!).  See
      <https://msdn.microsoft.com/en-us/library/14h5k7ff(VS.80).aspx>.  */
+# if _GL_WINDOWS_STAT_TIMESPEC
+  t = st->st_ctim;
+# else
   t.tv_sec = st->st_ctime;
   t.tv_nsec = 0;
+# endif
 #else
   /* Birth time is not supported.  */
   t.tv_sec = -1;


Reply via email to