Rob Landley | 84cb767 | 2006-01-06 20:59:09 +0000 | [diff] [blame] | 1 | /* vi: set sw=4 ts=4: */ |
| 2 | /* |
| 3 | * Busybox utility routines. |
| 4 | * |
| 5 | * Copyright (C) 2005 by Tito Ragusa <tito-wolit@tiscali.it> |
| 6 | * |
Denys Vlasenko | 0ef64bd | 2010-08-16 20:14:46 +0200 | [diff] [blame] | 7 | * Licensed under GPLv2, see file LICENSE in this source tree. |
Rob Landley | 84cb767 | 2006-01-06 20:59:09 +0000 | [diff] [blame] | 8 | */ |
Bernhard Reutner-Fischer | 421d9e5 | 2006-04-03 16:39:31 +0000 | [diff] [blame] | 9 | #include "libbb.h" |
Rob Landley | 84cb767 | 2006-01-06 20:59:09 +0000 | [diff] [blame] | 10 | |
Denys Vlasenko | 87bd558 | 2020-11-29 11:32:48 +0100 | [diff] [blame] | 11 | /* void FAST_FUNC bb_do_delay(int seconds) { ... } - no users yet */ |
Rob Landley | 84cb767 | 2006-01-06 20:59:09 +0000 | [diff] [blame] | 12 | |
Denys Vlasenko | 87bd558 | 2020-11-29 11:32:48 +0100 | [diff] [blame] | 13 | #ifndef LOGIN_FAIL_DELAY |
| 14 | #define LOGIN_FAIL_DELAY 3 |
| 15 | #endif |
| 16 | void FAST_FUNC pause_after_failed_login(void) |
| 17 | { |
| 18 | #if 0 /* over-engineered madness */ |
| 19 | time_t end, diff; |
| 20 | |
| 21 | end = time(NULL) + LOGIN_FAIL_DELAY; |
| 22 | diff = LOGIN_FAIL_DELAY; |
Denys Vlasenko | 12450db | 2009-10-27 09:54:34 +0100 | [diff] [blame] | 23 | do { |
Denys Vlasenko | 87bd558 | 2020-11-29 11:32:48 +0100 | [diff] [blame] | 24 | sleep(diff); |
| 25 | diff = end - time(NULL); |
| 26 | } while (diff > 0); |
| 27 | #else |
| 28 | sleep(LOGIN_FAIL_DELAY); |
| 29 | #endif |
Rob Landley | 84cb767 | 2006-01-06 20:59:09 +0000 | [diff] [blame] | 30 | } |
Denys Vlasenko | ec16c03 | 2020-11-29 11:37:34 +0100 | [diff] [blame^] | 31 | |
| 32 | void FAST_FUNC sleep1(void) |
| 33 | { |
| 34 | sleep(1); |
| 35 | } |
| 36 | |