diff options
author | ru <ru@FreeBSD.org> | 2001-09-14 13:42:26 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2001-09-14 13:42:26 +0000 |
commit | 3a475bde7a6172b4006c8c6d7318d76b6d06e2a8 (patch) | |
tree | 3b513c9f5796077111f2509be1b762fd70c7b2b5 /usr.bin/find | |
parent | 66b2cd14ab2bc1afb15b9049320d89fe9846e317 (diff) | |
download | FreeBSD-src-3a475bde7a6172b4006c8c6d7318d76b6d06e2a8.zip FreeBSD-src-3a475bde7a6172b4006c8c6d7318d76b6d06e2a8.tar.gz |
Simplify f_Xtime().
Diffstat (limited to 'usr.bin/find')
-rw-r--r-- | usr.bin/find/function.c | 35 |
1 files changed, 11 insertions, 24 deletions
diff --git a/usr.bin/find/function.c b/usr.bin/find/function.c index b477f20..bfe6a6d 100644 --- a/usr.bin/find/function.c +++ b/usr.bin/find/function.c @@ -302,32 +302,19 @@ f_Xtime(plan, entry) FTSENT *entry; { extern time_t now; - int exact_time; + time_t xtime; - exact_time = plan->flags & F_EXACTTIME; + if (plan->flags & F_TIME_A) + xtime = entry->fts_statp->st_atime; + else if (plan->flags & F_TIME_C) + xtime = entry->fts_statp->st_ctime; + else + xtime = entry->fts_statp->st_mtime; - if (plan->flags & F_TIME_C) { - if (exact_time) - COMPARE(now - entry->fts_statp->st_ctime, - plan->t_data); - else - COMPARE((now - entry->fts_statp->st_ctime + - 86400 - 1) / 86400, plan->t_data); - } else if (plan->flags & F_TIME_A) { - if (exact_time) - COMPARE(now - entry->fts_statp->st_atime, - plan->t_data); - else - COMPARE((now - entry->fts_statp->st_atime + - 86400 - 1) / 86400, plan->t_data); - } else { - if (exact_time) - COMPARE(now - entry->fts_statp->st_mtime, - plan->t_data); - else - COMPARE((now - entry->fts_statp->st_mtime + - 86400 - 1) / 86400, plan->t_data); - } + if (plan->flags & F_EXACTTIME) + COMPARE(now - xtime, plan->t_data); + else + COMPARE((now - xtime + 86400 - 1) / 86400, plan->t_data); } PLAN * |