Skip to content

Commit

Permalink
FreeBSD bug 204157: If filesystem does not support birthtime, then ma…
Browse files Browse the repository at this point in the history
…ke 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.
  • Loading branch information
kientzle committed Jun 24, 2016
1 parent ed9baee commit ad661cf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libarchive/test/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ad661cf

Please sign in to comment.