From: Tim Kientzle Date: Fri, 24 Jun 2016 05:16:03 +0000 (-0700) Subject: FreeBSD bug 204157: If filesystem does not support birthtime, then make all birthtim... X-Git-Tag: v3.2.2~44 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ad661cf39314a9772adad2e4d1d3967c26ffd4d3;p=thirdparty%2Flibarchive.git FreeBSD bug 204157: If filesystem does not support birthtime, then make all birthtime comparisons succeed. This is a bit of a hack: We should also have tests that verify different birthtimes. When/if that happens, we'll need to add a real system probe to determine whether birthtime is actually supported on this particular filesystem and skip tests accordingly. --- diff --git a/libarchive/test/main.c b/libarchive/test/main.c index 0f50e940c..7c266857b 100644 --- a/libarchive/test/main.c +++ b/libarchive/test/main.c @@ -1292,6 +1292,11 @@ assertion_file_time(const char *file, int line, switch (type) { case 'a': filet_nsec = st.st_atimespec.tv_nsec; break; case 'b': filet = st.st_birthtime; + /* FreeBSD filesystems that don't support birthtime + * (e.g., UFS1) always return -1 here. */ + if (filet == -1) { + return (1); + } filet_nsec = st.st_birthtimespec.tv_nsec; break; case 'm': filet_nsec = st.st_mtimespec.tv_nsec; break; default: fprintf(stderr, "INTERNAL: Bad type %c for file time", type);