]> Savannah Git Hosting - gnulib.git/commitdiff
stat-time: Adapt for windows-stat-timespec.
authorBruno Haible <bruno@clisp.org>
Sun, 14 May 2017 15:35:16 +0000 (17:35 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 14 May 2017 15:38:22 +0000 (17:38 +0200)
* lib/stat-time.h (get_stat_birthtime) [_GL_WINDOWS_STAT_TIMESPEC]: Use
entire st_ctim field.

ChangeLog
lib/stat-time.h

index 5a1d5c0f9ea059cc362fb6c088648151a1a89b73..39d6735119f97a6f4ae0b9cd71b42beb890dffdf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-05-14  Bruno Haible  <bruno@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.
+
 2017-05-13  Jim Meyering  <meyering@fb.com>
 
        maint.mk: update regex to reflect 2013 addition of "assume" to verify.h
index 88dcc7f3e0d630a52fdec4d639b63840d7bcffce..9e45e8556550852e4afbd82b996862dd99cde245 100644 (file)
@@ -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;