diff --git a/find/pred.c b/find/pred.c index 688103d6..9d7b0a0e 100644 --- a/find/pred.c +++ b/find/pred.c @@ -1166,8 +1166,13 @@ pred_used (const char *pathname, struct stat *stat_buf, struct predicate *pred_p /* TODO: this needs to be retested carefully (manually, if necessary) */ at = get_stat_atime (stat_buf); ct = get_stat_ctime (stat_buf); - delta.tv_sec = at.tv_sec - ct.tv_sec; - delta.tv_nsec = at.tv_nsec - ct.tv_nsec; + + /* Always evaluate to false if aime < ctime. */ + if (compare_ts (at, ct) < 0) + return false; + + delta.tv_sec = ct.tv_sec - at.tv_sec; + delta.tv_nsec = ct.tv_nsec - at.tv_nsec; if (delta.tv_nsec < 0) { delta.tv_nsec += 1000000000;