summaryrefslogtreecommitdiffstats
path: root/lib/libarchive/archive_entry_copy_stat.c
diff options
context:
space:
mode:
authorkientzle <kientzle@FreeBSD.org>2008-09-30 03:53:03 +0000
committerkientzle <kientzle@FreeBSD.org>2008-09-30 03:53:03 +0000
commit6902e811f60327dce35d2068d05d85a3c7a345c4 (patch)
tree7902e535fed29fc4c3fc23e05146625461053f86 /lib/libarchive/archive_entry_copy_stat.c
parent51dc1b851d697c82dd725789e7d2d156f445b980 (diff)
downloadFreeBSD-src-6902e811f60327dce35d2068d05d85a3c7a345c4.zip
FreeBSD-src-6902e811f60327dce35d2068d05d85a3c7a345c4.tar.gz
MfP4: Support for storing birthtime in archive_entry objects.
Submitted by: Pedro Giffuni MFC after: 30 days
Diffstat (limited to 'lib/libarchive/archive_entry_copy_stat.c')
-rw-r--r--lib/libarchive/archive_entry_copy_stat.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/libarchive/archive_entry_copy_stat.c b/lib/libarchive/archive_entry_copy_stat.c
index 5b3d35e..bd88b74 100644
--- a/lib/libarchive/archive_entry_copy_stat.c
+++ b/lib/libarchive/archive_entry_copy_stat.c
@@ -47,6 +47,12 @@ 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);
#endif
archive_entry_set_dev(entry, st->st_dev);
archive_entry_set_gid(entry, st->st_gid);
OpenPOWER on IntegriCloud