diff options
Diffstat (limited to 'bin/pax/cpio.c')
-rw-r--r-- | bin/pax/cpio.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/bin/pax/cpio.c b/bin/pax/cpio.c index 55950c144ad..8ff8836b80f 100644 --- a/bin/pax/cpio.c +++ b/bin/pax/cpio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cpio.c,v 1.26 2015/03/17 03:23:17 guenther Exp $ */ +/* $OpenBSD: cpio.c,v 1.27 2015/03/19 05:14:24 guenther Exp $ */ /* $NetBSD: cpio.c,v 1.5 1995/03/21 09:07:13 cgd Exp $ */ /*- @@ -298,7 +298,8 @@ cpio_rd(ARCHD *arcn, char *buf) arcn->sb.st_mtime = INT_MAX; /* XXX 2038 */ else arcn->sb.st_mtime = val; - arcn->sb.st_ctime = arcn->sb.st_atime = arcn->sb.st_mtime; + arcn->sb.st_mtim.tv_nsec = 0; + arcn->sb.st_ctim = arcn->sb.st_atim = arcn->sb.st_mtim; arcn->sb.st_size = (off_t)asc_uqd(hd->c_filesize,sizeof(hd->c_filesize), OCT); @@ -572,7 +573,8 @@ vcpio_rd(ARCHD *arcn, char *buf) arcn->sb.st_uid = (uid_t)asc_ul(hd->c_uid, sizeof(hd->c_uid), HEX); arcn->sb.st_gid = (gid_t)asc_ul(hd->c_gid, sizeof(hd->c_gid), HEX); arcn->sb.st_mtime = (time_t)asc_ul(hd->c_mtime,sizeof(hd->c_mtime),HEX); - arcn->sb.st_ctime = arcn->sb.st_atime = arcn->sb.st_mtime; + arcn->sb.st_mtim.tv_nsec = 0; + arcn->sb.st_ctim = arcn->sb.st_atim = arcn->sb.st_mtim; arcn->sb.st_size = (off_t)asc_uqd(hd->c_filesize, sizeof(hd->c_filesize), HEX); arcn->sb.st_nlink = (nlink_t)asc_ul(hd->c_nlink, sizeof(hd->c_nlink), @@ -892,7 +894,8 @@ bcpio_rd(ARCHD *arcn, char *buf) ((off_t)(SHRT_EXT(hd->h_filesize_2))); nsz = (int)(SHRT_EXT(hd->h_namesize)); } - arcn->sb.st_ctime = arcn->sb.st_atime = arcn->sb.st_mtime; + arcn->sb.st_mtim.tv_nsec = 0; + arcn->sb.st_ctim = arcn->sb.st_atim = arcn->sb.st_mtim; /* * check the file name size, if bogus give up. otherwise read the file |