1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-04 12:52:15 +00:00

Simplify f_Xtime().

This commit is contained in:
Ruslan Ermilov 2001-09-14 13:42:26 +00:00
parent adff4fca3d
commit 631a876574
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=83451

View File

@ -302,32 +302,19 @@ f_Xtime(plan, entry)
FTSENT *entry; FTSENT *entry;
{ {
extern time_t now; 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 (plan->flags & F_EXACTTIME)
if (exact_time) COMPARE(now - xtime, plan->t_data);
COMPARE(now - entry->fts_statp->st_ctime, else
plan->t_data); COMPARE((now - xtime + 86400 - 1) / 86400, 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);
}
} }
PLAN * PLAN *