]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Simplify birthtime handling and ensure that it is unset if the platform
authorJoerg Sonnenberger <joerg.sonnenberger@gmail.com>
Mon, 22 Feb 2010 03:24:33 +0000 (22:24 -0500)
committerJoerg Sonnenberger <joerg.sonnenberger@gmail.com>
Mon, 22 Feb 2010 03:24:33 +0000 (22:24 -0500)
doesn't support it.

SVN-Revision: 1956

libarchive/archive_entry_copy_stat.c

index 1a049ba3ba69dff58868aa4bc93e834aad17bce7..37d4d6edbd86691a0dae65ebfed6f2c478fc2a15 100644 (file)
@@ -60,12 +60,13 @@ archive_entry_copy_stat(struct archive_entry *entry, const struct stat *st)
        archive_entry_set_atime(entry, st->st_atime, 0);
        archive_entry_set_ctime(entry, st->st_ctime, 0);
        archive_entry_set_mtime(entry, st->st_mtime, 0);
-#if HAVE_STRUCT_STAT_ST_BIRTHTIME
-       archive_entry_set_birthtime(entry, st->st_birthtime, 0);
-#endif
 #endif
 #if HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC
        archive_entry_set_birthtime(entry, st->st_birthtime, st->st_birthtimespec.tv_nsec);
+#elif HAVE_STRUCT_STAT_ST_BIRTHTIME
+       archive_entry_set_birthtime(entry, st->st_birthtime, 0);
+#else
+       archive_entry_unset_birthtime(entry);
 #endif
        archive_entry_set_dev(entry, st->st_dev);
        archive_entry_set_gid(entry, st->st_gid);