From: Ben Gras Date: Mon, 14 Jan 2013 23:19:35 +0000 (+0000) Subject: tar: use utime() to restore timestamps X-Git-Tag: v3.2.1~102 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/mdoc.3.txt?a=commitdiff_plain;h=e9a6abd046b3e54c5a0839188c84c27bc741d27e;p=minix.git tar: use utime() to restore timestamps . otherwise all extracted files get 'now' --- 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