From 84cb76733f0e5853a6c7c2f64b1c168e61dfd933 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Fri, 6 Jan 2006 20:59:09 +0000 Subject: patch from tito: consolidate delay functions as bb_do_delay() --- loginutils/sulogin.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'loginutils/sulogin.c') diff --git a/loginutils/sulogin.c b/loginutils/sulogin.c index 4e689ad68..f54939eef 100644 --- a/loginutils/sulogin.c +++ b/loginutils/sulogin.c @@ -58,7 +58,6 @@ extern int sulogin_main(int argc, char **argv) struct passwd pwent; struct passwd *pwd; - time_t start, now; const char * const *p; #ifdef CONFIG_FEATURE_SHADOWPASSWDS struct spwd *spwd = NULL; @@ -140,12 +139,7 @@ extern int sulogin_main(int argc, char **argv) if (strcmp(pw_encrypt(pass, pwent.pw_passwd), pwent.pw_passwd) == 0) { break; } - time(&start); - now = start; - while (difftime(now, start) < FAIL_DELAY) { - sleep(FAIL_DELAY); - time(&now); - } + bb_do_delay(FAIL_DELAY); puts("Login incorrect"); fflush(stdout); syslog(LOG_WARNING, "Incorrect root password\n"); -- cgit v1.2.3