blob: 3a86dc2ae2e3f04bfc30f38fe0d8423cc4c95d03 [file] [log] [blame]
Rob Landley84cb7672006-01-06 20:59:09 +00001/* 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 Vlasenko0ef64bd2010-08-16 20:14:46 +02007 * Licensed under GPLv2, see file LICENSE in this source tree.
Rob Landley84cb7672006-01-06 20:59:09 +00008 */
Bernhard Reutner-Fischer421d9e52006-04-03 16:39:31 +00009#include "libbb.h"
Rob Landley84cb7672006-01-06 20:59:09 +000010
Denys Vlasenko87bd5582020-11-29 11:32:48 +010011/* void FAST_FUNC bb_do_delay(int seconds) { ... } - no users yet */
Rob Landley84cb7672006-01-06 20:59:09 +000012
Denys Vlasenko87bd5582020-11-29 11:32:48 +010013#ifndef LOGIN_FAIL_DELAY
14#define LOGIN_FAIL_DELAY 3
15#endif
16void 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 Vlasenko12450db2009-10-27 09:54:34 +010023 do {
Denys Vlasenko87bd5582020-11-29 11:32:48 +010024 sleep(diff);
25 diff = end - time(NULL);
26 } while (diff > 0);
27#else
28 sleep(LOGIN_FAIL_DELAY);
29#endif
Rob Landley84cb7672006-01-06 20:59:09 +000030}
Denys Vlasenkoec16c032020-11-29 11:37:34 +010031
32void FAST_FUNC sleep1(void)
33{
34 sleep(1);
35}
36