]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Correct a couple of typos in the missing-atime and missing-mtime logic
authorTim Kientzle <kientzle@gmail.com>
Sat, 30 Aug 2008 23:29:46 +0000 (19:29 -0400)
committerTim Kientzle <kientzle@gmail.com>
Sat, 30 Aug 2008 23:29:46 +0000 (19:29 -0400)
SVN-Revision: 191

libarchive/archive_entry.c
libarchive/archive_entry.h
libarchive/archive_entry_private.h
libarchive/archive_write_disk.c

index a8b0f5ba5fd028f16636de2b9688ac56b97d6691..53f86da758e8e1894c01dd094e1487c391311dd5 100644 (file)
@@ -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;
 }
index f409cbd8a524832f3c38176c4206a8a9ff335843..671a24627e5ca21d3866b10784adf54c7495c425 100644 (file)
@@ -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:
index 0aa05e5a768ab7766b7bd534207b4c903cdb68b3..60a3a0b237bb20a10fc7afba9e01870952307768 100644 (file)
@@ -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.
index f0ce6249f26fa30b9a5909b7971b828eb2c0cc30..1c480f8b952ef03de0683775d206271c96c465b3 100644 (file)
@@ -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)) {