From: Michihiro NAKAJIMA Date: Thu, 31 Mar 2011 05:29:45 +0000 (-0400) Subject: If futimens() defined in POSIX.1-2008 is available, use it for linux. X-Git-Tag: v3.0.0a~541 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d9fa5dc331f8371a748a5baa63d7a0d0c2e6f5af;p=thirdparty%2Flibarchive.git If futimens() defined in POSIX.1-2008 is available, use it for linux. SVN-Revision: 3140 --- diff --git a/libarchive/archive_read_disk_posix.c b/libarchive/archive_read_disk_posix.c index aa8bdc504..593904806 100644 --- a/libarchive/archive_read_disk_posix.c +++ b/libarchive/archive_read_disk_posix.c @@ -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