From: Tim Kientzle Date: Fri, 13 Nov 2009 06:22:01 +0000 (-0500) Subject: The ustar header for the 'x' entry in pax format can be simplified: X-Git-Tag: v2.8.0~167 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5c96e78be976203c14bb0e3d1fb772deef7804e9;p=thirdparty%2Flibarchive.git The ustar header for the 'x' entry in pax format can be simplified: ustar headers can't support high-res mtime and don't support atime at all. Also, work around an annoying compiler warning pointed out by Bill Hoffman. SVN-Revision: 1648 --- diff --git a/libarchive/archive_write_set_format_pax.c b/libarchive/archive_write_set_format_pax.c index f12168b6b..ae3b2b5ae 100644 --- a/libarchive/archive_write_set_format_pax.c +++ b/libarchive/archive_write_set_format_pax.c @@ -887,7 +887,6 @@ archive_write_pax_header(struct archive_write *a, uid_t uid; gid_t gid; mode_t mode; - long ns; pax_attr_entry = archive_entry_new(); p = archive_entry_pathname(entry_main); @@ -925,17 +924,12 @@ archive_write_pax_header(struct archive_write *a, /* Copy mtime, but clip to ustar limits. */ s = archive_entry_mtime(entry_main); - ns = archive_entry_mtime_nsec(entry_main); - if (s < 0) { s = 0; ns = 0; } - if (s > 0x7fffffff) { s = 0x7fffffff; ns = 0; } - archive_entry_set_mtime(pax_attr_entry, s, ns); - - /* Ditto for atime. */ - s = archive_entry_atime(entry_main); - ns = archive_entry_atime_nsec(entry_main); - if (s < 0) { s = 0; ns = 0; } - if (s > 0x7fffffff) { s = 0x7fffffff; ns = 0; } - archive_entry_set_atime(pax_attr_entry, s, ns); + if (s < 0) { s = 0; } + if (s >= 0x7fffffff) { s = 0x7fffffff; } + archive_entry_set_mtime(pax_attr_entry, s, 0); + + /* Standard ustar doesn't support atime. */ + archive_entry_set_atime(pax_attr_entry, 0, 0); /* Standard ustar doesn't support ctime. */ archive_entry_set_ctime(pax_attr_entry, 0, 0);