]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
If futimens() defined in POSIX.1-2008 is available, use it for linux.
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Thu, 31 Mar 2011 05:29:45 +0000 (01:29 -0400)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Thu, 31 Mar 2011 05:29:45 +0000 (01:29 -0400)
SVN-Revision: 3140

libarchive/archive_read_disk_posix.c

index aa8bdc504f691d6458486ebcda37f9965a66f00d..593904806d9d18b1594dd5f66cc223f29b5b05e1 100644 (file)
@@ -1671,7 +1671,11 @@ close_and_restore_time(int fd, struct tree *t, struct restore_time *rt)
        times[0].tv_sec = rt->atime;
        times[0].tv_usec = rt->atime_nsec / 1000;
 
-#if defined(HAVE_FUTIMES) && !defined(__CYGWIN__)
+#if defined(HAVE_FUTIMENS) && !defined(__CYGWIN__)
+       /* futimens() is defined in POSIX.1-2008. */
+       if (futimens(fd, times) == 0)
+               return (close(fd));
+#elif defined(HAVE_FUTIMES) && !defined(__CYGWIN__)
        if (futimes(fd, times) == 0)
                return (close(fd));
 #endif