summaryrefslogtreecommitdiff
path: root/loginutils/passwd.c
diff options
context:
space:
mode:
authorRob Landley2006-01-06 20:59:09 +0000
committerRob Landley2006-01-06 20:59:09 +0000
commit84cb76733f0e5853a6c7c2f64b1c168e61dfd933 (patch)
treee9315133e3d21ea032e5e676ddb3f39e18be5605 /loginutils/passwd.c
parent251161f75c0895a1138f87bd80d9bcc38e567444 (diff)
downloadbusybox-84cb76733f0e5853a6c7c2f64b1c168e61dfd933.zip
busybox-84cb76733f0e5853a6c7c2f64b1c168e61dfd933.tar.gz
patch from tito: consolidate delay functions as bb_do_delay()
Diffstat (limited to 'loginutils/passwd.c')
-rw-r--r--loginutils/passwd.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/loginutils/passwd.c b/loginutils/passwd.c
index 5d8380d..b60b897 100644
--- a/loginutils/passwd.c
+++ b/loginutils/passwd.c
@@ -323,7 +323,6 @@ static int new_password(const struct passwd *pw, int amroot, int algo)
char *cp;
char orig[200];
char pass[200];
- time_t start, now;
if (!amroot && crypt_passwd[0]) {
if (!(clear = bb_askpass(0, "Old password:"))) {
@@ -334,12 +333,7 @@ static int new_password(const struct passwd *pw, int amroot, int algo)
if (strcmp(cipher, crypt_passwd) != 0) {
syslog(LOG_WARNING, "incorrect password for `%s'",
pw->pw_name);
- time(&start);
- now = start;
- while (difftime(now, start) < FAIL_DELAY) {
- sleep(FAIL_DELAY);
- time(&now);
- }
+ bb_do_delay(FAIL_DELAY);
fprintf(stderr, "Incorrect password.\n");
/* return -1; */
return 1;