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
This commit is contained in:
Kyle Evans 2018-04-12 14:32:26 +00:00
parent ac220fb3b7
commit a97c64453d

View File

@ -86,7 +86,7 @@ load_database(old_db)
if (dp->d_name[0] == '.') if (dp->d_name[0] == '.')
continue; continue;
ret = fstatat(dirfd(dir), dp->d_name, &st, 0); 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; continue;
maxmtime = TMAX(st.st_mtime, maxmtime); maxmtime = TMAX(st.st_mtime, maxmtime);
} }