From a97c64453d05a149ef5dce55d2f73deb5e124ecd Mon Sep 17 00:00:00 2001 From: Kyle Evans Date: Thu, 12 Apr 2018 14:32:26 +0000 Subject: cron(8): Correct test sense We're about to use the result of fstat(2) either way, so don't do that if it fails... X-MFC-With: r332429 --- usr.sbin/cron/cron/database.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'usr.sbin/cron') diff --git a/usr.sbin/cron/cron/database.c b/usr.sbin/cron/cron/database.c index 6665d87ea482..f8c6aa934f9d 100644 --- a/usr.sbin/cron/cron/database.c +++ b/usr.sbin/cron/cron/database.c @@ -86,7 +86,7 @@ load_database(old_db) if (dp->d_name[0] == '.') continue; ret = fstatat(dirfd(dir), dp->d_name, &st, 0); - if (ret == 0 && !S_ISREG(st.st_mode)) + if (ret != 0 || !S_ISREG(st.st_mode)) continue; maxmtime = TMAX(st.st_mtime, maxmtime); } -- cgit v1.2.3