From e9a6abd046b3e54c5a0839188c84c27bc741d27e Mon Sep 17 00:00:00 2001 From: Ben Gras Date: Mon, 14 Jan 2013 23:19:35 +0000 Subject: [PATCH] tar: use utime() to restore timestamps . otherwise all extracted files get 'now' --- bin/pax/file_subs.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/bin/pax/file_subs.c b/bin/pax/file_subs.c index ea7a66a8b..e6ba65e49 100644 --- a/bin/pax/file_subs.c +++ b/bin/pax/file_subs.c @@ -62,6 +62,10 @@ __RCSID("$NetBSD: file_subs.c,v 1.62 2009/04/07 19:52:35 perry Exp $"); #include "extern.h" #include "options.h" +#ifdef __minix +#include +#endif + char *xtmp_name; static int @@ -842,8 +846,15 @@ set_ftime(char *fnm, time_t mtime, time_t atime, int frc, int slk) #endif if (slk) return; -#ifndef __minix -/* LSC: FIXME UGLY Hack */ +#ifdef __minix + { + struct utimbuf timp; + timp.actime = atime; + timp.modtime = mtime; + if (utime(fnm, &timp) < 0) + goto bad; + } +#else if (utimes(fnm, tv) == -1) goto bad; #endif -- 2.11.4.GIT