X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fextract.c;h=2296066591624d6fb7bd8b8089632402cef3b225;hb=ecbcb7b6d74c2d69386c8d7e435486a4690c9993;hp=4bf27915169f7efe53a148b64fe5b8d332762576;hpb=59146768ef4a2c045239628b7179ea477563d63f;p=chaz%2Ftar diff --git a/src/extract.c b/src/extract.c index 4bf2791..2296066 100644 --- a/src/extract.c +++ b/src/extract.c @@ -21,7 +21,6 @@ #include #include -#include #include #include @@ -304,24 +303,19 @@ set_stat (char const *file_name, if (! touch_option && permstatus != INTERDIR_PERMSTATUS) { - /* We set the accessed time to `now', which is really the time we - started extracting files, unless incremental_option is used, in - which case .st_atime is used. */ - - /* FIXME: incremental_option should set ctime too, but how? */ - struct timespec ts[2]; if (incremental_option) ts[0] = st->atime; else - ts[0] = start_time; + ts[0].tv_nsec = UTIME_NOW; ts[1] = st->mtime; - if (fdutimens (file_name, fd, ts) != 0) + if (fd_utimensat (fd, AT_FDCWD, file_name, ts, 0) != 0) utime_error (file_name); else { - check_time (file_name, ts[0]); + if (incremental_option) + check_time (file_name, ts[0]); check_time (file_name, ts[1]); } }