diff --git a/lib/failure.c b/lib/failure.c index 55a10a71..22acc231 100644 --- a/lib/failure.c +++ b/lib/failure.c @@ -82,7 +82,7 @@ void failure (uid_t uid, const char *tty, struct faillog *fl) } STRTCPY(fl->fail_line, tty); - (void) time (&fl->fail_time); + fl->fail_time = time(NULL); /* * Seek back to the correct position in the file and write the @@ -126,7 +126,7 @@ static bool too_many_failures (const struct faillog *fl) return true; /* locked until reset manually */ } - (void) time (&now); + now = time(NULL); if ((fl->fail_time + fl->fail_locktime) < now) { return false; /* enough time since last failure */ } diff --git a/lib/log.c b/lib/log.c index fd78c682..e195a0f9 100644 --- a/lib/log.c +++ b/lib/log.c @@ -79,7 +79,7 @@ void dolastlog ( } ll_time = newlog.ll_time; - (void) time (&ll_time); + ll_time = time(NULL); newlog.ll_time = ll_time; STRTCPY(newlog.ll_line, line); #if HAVE_LL_HOST diff --git a/lib/sulog.c b/lib/sulog.c index 2ef22b2e..82f3ab77 100644 --- a/lib/sulog.c +++ b/lib/sulog.c @@ -68,7 +68,7 @@ void sulog (const char *tty, bool success, const char *oldname, const char *name return; /* can't open or create logfile */ } - (void) time (&now); + now = time(NULL); tm = localtime (&now); fprintf (fp, "SU %.02d/%.02d %.02d:%.02d %c %s %s-%s\n", diff --git a/src/faillog.c b/src/faillog.c index 77c25b8a..75910bb6 100644 --- a/src/faillog.c +++ b/src/faillog.c @@ -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)) { diff --git a/src/logoutd.c b/src/logoutd.c index eb4c6fe2..a0d0f36c 100644 --- a/src/logoutd.c +++ b/src/logoutd.c @@ -55,7 +55,7 @@ check_login(const struct utmpx *ut) ZUSTR2STP(user, ut->ut_user); ZUSTR2STP(line, ut->ut_line); - (void) time (&now); + now = time(NULL); /* * Check if they are allowed to be logged in right now.