aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libbb/bb_do_delay.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/libbb/bb_do_delay.c b/libbb/bb_do_delay.c
index 3d52cc562..139dc1878 100644
--- a/libbb/bb_do_delay.c
+++ b/libbb/bb_do_delay.c
@@ -13,10 +13,9 @@ void FAST_FUNC bb_do_delay(int seconds)
13{ 13{
14 time_t start, now; 14 time_t start, now;
15 15
16 time(&start); 16 start = time(NULL);
17 now = start; 17 do {
18 while (difftime(now, start) < seconds) {
19 sleep(seconds); 18 sleep(seconds);
20 time(&now); 19 now = time(NULL);
21 } 20 } while ((now - start) < seconds);
22} 21}