diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2020-11-29 12:40:25 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2020-11-29 12:40:25 +0100 |
commit | 6a55b4e403979ba299261816a7ec1bb55bbf3f2b (patch) | |
tree | d8eba6a7c1483c33547549b07081e9549baa094c /miscutils | |
parent | b86a9ed699e2c4693167d6ead00ac307bd9c01c6 (diff) | |
download | busybox-w32-6a55b4e403979ba299261816a7ec1bb55bbf3f2b.tar.gz busybox-w32-6a55b4e403979ba299261816a7ec1bb55bbf3f2b.tar.bz2 busybox-w32-6a55b4e403979ba299261816a7ec1bb55bbf3f2b.zip |
libbb: introduce and use msleep()
function old new delta
msleep - 45 +45
watchdog_main 271 266 -5
common_traceroute_main 3546 3530 -16
beep_main 277 248 -29
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/3 up/down: 45/-50) Total: -5 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'miscutils')
-rw-r--r-- | miscutils/beep.c | 4 | ||||
-rw-r--r-- | miscutils/watchdog.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/miscutils/beep.c b/miscutils/beep.c index 1669332fd..7c60aed08 100644 --- a/miscutils/beep.c +++ b/miscutils/beep.c | |||
@@ -114,10 +114,10 @@ int beep_main(int argc, char **argv) | |||
114 | while (rep) { | 114 | while (rep) { |
115 | //bb_error_msg("rep[%d] freq=%d, length=%d, delay=%d", rep, freq, length, delay); | 115 | //bb_error_msg("rep[%d] freq=%d, length=%d, delay=%d", rep, freq, length, delay); |
116 | xioctl(speaker, KIOCSOUND, (void*)(uintptr_t)tickrate_div_freq); | 116 | xioctl(speaker, KIOCSOUND, (void*)(uintptr_t)tickrate_div_freq); |
117 | usleep(1000 * length); | 117 | msleep(length); |
118 | ioctl(speaker, KIOCSOUND, (void*)0); | 118 | ioctl(speaker, KIOCSOUND, (void*)0); |
119 | if (--rep) | 119 | if (--rep) |
120 | usleep(1000 * delay); | 120 | msleep(delay); |
121 | } | 121 | } |
122 | } | 122 | } |
123 | 123 | ||
diff --git a/miscutils/watchdog.c b/miscutils/watchdog.c index 8c8d7217f..971b777a3 100644 --- a/miscutils/watchdog.c +++ b/miscutils/watchdog.c | |||
@@ -143,7 +143,7 @@ int watchdog_main(int argc UNUSED_PARAM, char **argv) | |||
143 | * as the counter value is undefined at this point -- PFM | 143 | * as the counter value is undefined at this point -- PFM |
144 | */ | 144 | */ |
145 | write(3, "", 1); /* write zero byte */ | 145 | write(3, "", 1); /* write zero byte */ |
146 | usleep(stimer_duration * 1000L); | 146 | msleep(stimer_duration); |
147 | } | 147 | } |
148 | return EXIT_SUCCESS; /* - not reached, but gcc 4.2.1 is too dumb! */ | 148 | return EXIT_SUCCESS; /* - not reached, but gcc 4.2.1 is too dumb! */ |
149 | } | 149 | } |