diff options
author | kientzle <kientzle@FreeBSD.org> | 2008-09-01 02:50:24 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2008-09-01 02:50:24 +0000 |
commit | 7711ed1cf5919924b612fc93447f26d27f150b24 (patch) | |
tree | b7066e848f645d464c68a48027f4562a9647215e /lib/libarchive/test/test_write_disk.c | |
parent | 7f570176d925106cd1af5dab102fa15b5e5dea8d (diff) | |
download | FreeBSD-src-7711ed1cf5919924b612fc93447f26d27f150b24.zip FreeBSD-src-7711ed1cf5919924b612fc93447f26d27f150b24.tar.gz |
Use the "start_time" (time at which the restore process began)
to fill in a missing atime instead of substituting mtime.
PR: bin/124915
Diffstat (limited to 'lib/libarchive/test/test_write_disk.c')
-rw-r--r-- | lib/libarchive/test/test_write_disk.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libarchive/test/test_write_disk.c b/lib/libarchive/test/test_write_disk.c index 6acc6ce..cb9ef62 100644 --- a/lib/libarchive/test/test_write_disk.c +++ b/lib/libarchive/test/test_write_disk.c @@ -60,6 +60,7 @@ static void create_reg_file(struct archive_entry *ae, const char *msg) static const char data[]="abcdefghijklmnopqrstuvwxyz"; struct archive *ad; struct stat st; + time_t now; /* Write the entry to disk. */ assert((ad = archive_write_disk_new()) != NULL); @@ -97,10 +98,11 @@ static void create_reg_file(struct archive_entry *ae, const char *msg) failure("st.st_mode=%o archive_entry_mode(ae)=%o", st.st_mode, archive_entry_mode(ae)); assertEqualInt(st.st_mode, (archive_entry_mode(ae) & ~UMASK)); - failure("No atime was specified, so atime should get set to mtime"); - assertEqualInt(st.st_atime, st.st_mtime); assertEqualInt(st.st_size, sizeof(data)); assertEqualInt(st.st_mtime, 123456789); + failure("No atime was specified, so atime should get set to current time"); + now = time(NULL); + assert(st.st_atime <= now && st.st_atime > now - 5); } static void create_reg_file2(struct archive_entry *ae, const char *msg) |