lib/, src/: Always pass NULL to time(2)

See time(2):

BUGS
     Error returns from this system  call  are  indistinguishable  from
     successful  reports  that  the  time  is  a few seconds before the
     Epoch, so the C library wrapper function never sets errno as a re‐
     sult of this call.

     The tloc argument is obsolescent and should always be NULL in  new
     code.  When tloc is NULL, the call cannot fail.

Fixes: 45c6603cc8 ("[svn-upgrade] Integrating new upstream version, shadow (19990709)")
Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
Alejandro Colomar
2024-05-14 19:58:36 +02:00
committed by Serge Hallyn
parent 761eb07016
commit bfb6aad7cb
5 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -154,7 +154,7 @@ static void print_one (/*@null@*/const struct passwd *pw, bool force)
return;
}
(void) time(&now);
now = time(NULL);
/* Filter out entries that do not match with the -t option */
if (tflg && ((now - fl.fail_time) > seconds)) {