summaryrefslogtreecommitdiffstats
path: root/src/ar.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ar.c')
-rw-r--r--src/ar.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ar.c b/src/ar.c
index 1320d07b..f1f1533e 100644
--- a/src/ar.c
+++ b/src/ar.c
@@ -685,7 +685,14 @@ do_oper_extract (int oper, const char *arfname, char **argv, int argc,
tv[1].tv_sec = arhdr->ar_date;
tv[1].tv_nsec = 0;
+#ifdef HAVE_FUTIMENS
if (unlikely (futimens (xfd, tv) != 0))
+#else
+ struct timeval times[2];
+ TIMESPEC_TO_TIMEVAL (&times[0], &tv[0]);
+ TIMESPEC_TO_TIMEVAL (&times[1], &tv[1]);
+ if (unlikely (futimes (xfd, times) != 0))
+#endif
{
error (0, errno,
gettext ("cannot change modification time of %s"),