blob: 223924e68aaa09dc1a08315cd7201b2279ebcad1 [file] [log] [blame]
--- elfutils-0.161/src/ar.c.orig 2016-10-05 14:39:38.874247793 -0400
+++ elfutils-0.161/src/ar.c 2016-10-05 15:13:41.983019138 -0400
@@ -47,6 +47,11 @@
#include "arlib.h"
+#ifdef HAVE_FUTIMES
+# define FUTIMES(fd, fname, tvp) futimes (fd, tvp)
+#else
+# define FUTIMES(fd, fname, tvp) utimes (fname, tvp)
+#endif
/* Name and version of program. */
static void print_version (FILE *stream, struct argp_state *state);
@@ -692,7 +697,8 @@
tv[1].tv_sec = arhdr->ar_date;
tv[1].tv_usec = 0;
- if (unlikely (futimes (xfd, tv) != 0))
+ if (unlikely (FUTIMES (xfd, use_mkstemp ? tempfname :
+ arhdr->ar_name, tv) != 0))
{
error (0, errno,
gettext ("cannot change modification time of %s"),