diff options
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/bb_do_delay.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/libbb/bb_do_delay.c b/libbb/bb_do_delay.c index 65541704b..29343305d 100644 --- a/libbb/bb_do_delay.c +++ b/libbb/bb_do_delay.c @@ -8,13 +8,23 @@ */ #include "libbb.h" -void FAST_FUNC bb_do_delay(int seconds) +/* void FAST_FUNC bb_do_delay(int seconds) { ... } - no users yet */ + +#ifndef LOGIN_FAIL_DELAY +#define LOGIN_FAIL_DELAY 3 +#endif +void FAST_FUNC pause_after_failed_login(void) { - time_t start, now; +#if 0 /* over-engineered madness */ + time_t end, diff; - start = time(NULL); + end = time(NULL) + LOGIN_FAIL_DELAY; + diff = LOGIN_FAIL_DELAY; do { - sleep(seconds); - now = time(NULL); - } while ((now - start) < seconds); + sleep(diff); + diff = end - time(NULL); + } while (diff > 0); +#else + sleep(LOGIN_FAIL_DELAY); +#endif } |