summaryrefslogtreecommitdiffstats
path: root/Utilities
diff options
context:
space:
mode:
authorRolf Eike Beer <eike@sf-mail.de>2014-06-06 15:44:16 (GMT)
committerBrad King <brad.king@kitware.com>2014-06-09 14:15:27 (GMT)
commit478b1c8b36e55001e8cb9ec10993d7ac1e78e189 (patch)
tree9b3c94c9492bc82200fb925ae30e9028114d5b37 /Utilities
parenteca798149b7cde03bce618ce4b1046a0e2356ce0 (diff)
downloadCMake-478b1c8b36e55001e8cb9ec10993d7ac1e78e189.zip
CMake-478b1c8b36e55001e8cb9ec10993d7ac1e78e189.tar.gz
CMake-478b1c8b36e55001e8cb9ec10993d7ac1e78e189.tar.bz2
libarchive: fix compilation on newer HP-UX versions
Newer HP-UX versions (e.g. 11.31) also offers F_SETTIMES, but with a different struct for the timing information. Suggested-by: Eric Berge <ericmberge@gmail.com>
Diffstat (limited to 'Utilities')
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_write_disk_posix.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/Utilities/cmlibarchive/libarchive/archive_write_disk_posix.c b/Utilities/cmlibarchive/libarchive/archive_write_disk_posix.c
index b69c873..962f2ca 100644
--- a/Utilities/cmlibarchive/libarchive/archive_write_disk_posix.c
+++ b/Utilities/cmlibarchive/libarchive/archive_write_disk_posix.c
@@ -2861,7 +2861,7 @@ set_time(int fd, int mode, const char *name,
#endif
}
-#ifdef F_SETTIMES /* Tru64 */
+#ifdef F_SETTIMES
static int
set_time_tru64(int fd, int mode, const char *name,
time_t atime, long atime_nsec,
@@ -2869,19 +2869,21 @@ set_time_tru64(int fd, int mode, const char *name,
time_t ctime, long ctime_nsec)
{
struct attr_timbuf tstamp;
- struct timeval times[3];
- times[0].tv_sec = atime;
- times[0].tv_usec = atime_nsec / 1000;
- times[1].tv_sec = mtime;
- times[1].tv_usec = mtime_nsec / 1000;
- times[2].tv_sec = ctime;
- times[2].tv_usec = ctime_nsec / 1000;
- tstamp.atime = times[0];
- tstamp.mtime = times[1];
- tstamp.ctime = times[2];
+ tstamp.atime.tv_sec = atime;
+ tstamp.mtime.tv_sec = mtime;
+ tstamp.ctime.tv_sec = ctime;
+#if defined (__hpux) && defined (__ia64)
+ tstamp.atime.tv_nsec = atime_nsec;
+ tstamp.mtime.tv_nsec = mtime_nsec;
+ tstamp.ctime.tv_nsec = ctime_nsec;
+#else
+ tstamp.atimetv_usec = atime_nsec / 1000;
+ tstamp.mtime.tv_usec = mtime_nsec / 1000;
+ tstamp.ctime.tv_usec = ctime_nsec / 1000;
+#endif
return (fcntl(fd,F_SETTIMES,&tstamp));
}
-#endif /* Tru64 */
+#endif /* F_SETTIMES */
static int
set_times(struct archive_write_disk *a,