From 0d6b5cc7444916b487abc86b07a96aabf37be16a Mon Sep 17 00:00:00 2001 From: Tim Kientzle Date: Sat, 30 Aug 2008 19:29:46 -0400 Subject: [PATCH] Correct a couple of typos in the missing-atime and missing-mtime logic SVN-Revision: 191 --- libarchive/archive_entry.c | 8 ++++++++ libarchive/archive_entry.h | 2 ++ libarchive/archive_entry_private.h | 5 ++++- libarchive/archive_write_disk.c | 2 +- 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/libarchive/archive_entry.c b/libarchive/archive_entry.c index a8b0f5ba5..53f86da75 100644 --- a/libarchive/archive_entry.c +++ b/libarchive/archive_entry.c @@ -604,6 +604,12 @@ archive_entry_mtime_nsec(struct archive_entry *entry) return (entry->ae_stat.aest_mtime_nsec); } +int +archive_entry_mtime_is_set(struct archive_entry *entry) +{ + return (entry->ae_set & AE_SET_MTIME); +} + unsigned int archive_entry_nlink(struct archive_entry *entry) { @@ -822,6 +828,7 @@ void archive_entry_set_ctime(struct archive_entry *entry, time_t t, long ns) { entry->stat_valid = 0; + entry->ae_set |= AE_SET_CTIME; entry->ae_stat.aest_ctime = t; entry->ae_stat.aest_ctime_nsec = ns; } @@ -900,6 +907,7 @@ void archive_entry_set_mtime(struct archive_entry *entry, time_t m, long ns) { entry->stat_valid = 0; + entry->ae_set |= AE_SET_MTIME; entry->ae_stat.aest_mtime = m; entry->ae_stat.aest_mtime_nsec = ns; } diff --git a/libarchive/archive_entry.h b/libarchive/archive_entry.h index f409cbd8a..671a24627 100644 --- a/libarchive/archive_entry.h +++ b/libarchive/archive_entry.h @@ -191,6 +191,7 @@ __LA_DECL __LA_INO_T archive_entry_ino(struct archive_entry *); __LA_DECL __LA_MODE_T archive_entry_mode(struct archive_entry *); __LA_DECL time_t archive_entry_mtime(struct archive_entry *); __LA_DECL long archive_entry_mtime_nsec(struct archive_entry *); +__LA_DECL int archive_entry_mtime_is_set(struct archive_entry *); __LA_DECL unsigned int archive_entry_nlink(struct archive_entry *); __LA_DECL const char *archive_entry_pathname(struct archive_entry *); __LA_DECL const wchar_t *archive_entry_pathname_w(struct archive_entry *); @@ -279,6 +280,7 @@ __LA_DECL int archive_entry_update_uname_utf8(struct archive_entry *, const char __LA_DECL const struct stat *archive_entry_stat(struct archive_entry *); __LA_DECL void archive_entry_copy_stat(struct archive_entry *, const struct stat *); + /* * ACL routines. This used to simply store and return text-format ACL * strings, but that proved insufficient for a number of reasons: diff --git a/libarchive/archive_entry_private.h b/libarchive/archive_entry_private.h index 0aa05e5a7..60a3a0b23 100644 --- a/libarchive/archive_entry_private.h +++ b/libarchive/archive_entry_private.h @@ -140,7 +140,10 @@ struct archive_entry { #define AE_SET_HARDLINK 1 #define AE_SET_SYMLINK 2 #define AE_SET_ATIME 4 -#define AE_SET_SIZE 32 +#define AE_SET_CTIME 8 +#define AE_SET_MTIME 16 +#define AE_SET_BIRTHTIME 32 +#define AE_SET_SIZE 64 /* * Use aes here so that we get transparent mbs<->wcs conversions. diff --git a/libarchive/archive_write_disk.c b/libarchive/archive_write_disk.c index f0ce6249f..1c480f8b9 100644 --- a/libarchive/archive_write_disk.c +++ b/libarchive/archive_write_disk.c @@ -445,7 +445,7 @@ _archive_write_header(struct archive *_a, struct archive_entry *entry) if ((a->deferred & TODO_TIMES) && (archive_entry_mtime_is_set(entry) - || archive_entry_atime_is_set(entry)))) { + || archive_entry_atime_is_set(entry))) { fe = current_fixup(a, archive_entry_pathname(entry)); fe->fixup |= TODO_TIMES; if (archive_entry_mtime_is_set(entry)) { -- 2.47.3