aboutsummaryrefslogtreecommitdiff
path: root/coreutils/sleep.c
diff options
context:
space:
mode:
Diffstat (limited to 'coreutils/sleep.c')
-rw-r--r--coreutils/sleep.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/coreutils/sleep.c b/coreutils/sleep.c
index b89b0fe9c..592005bab 100644
--- a/coreutils/sleep.c
+++ b/coreutils/sleep.c
@@ -18,12 +18,12 @@
18 * time suffixes for seconds, minutes, hours, and days. 18 * time suffixes for seconds, minutes, hours, and days.
19 */ 19 */
20 20
21#include <stdlib.h>
22#include <limits.h>
23#include <unistd.h>
24#include "busybox.h" 21#include "busybox.h"
25 22
26#ifdef CONFIG_FEATURE_FANCY_SLEEP 23/* This is a NOFORK applet. Be very careful! */
24
25
26#if ENABLE_FEATURE_FANCY_SLEEP
27static const struct suffix_mult sfx[] = { 27static const struct suffix_mult sfx[] = {
28 { "s", 1 }, 28 { "s", 1 },
29 { "m", 60 }, 29 { "m", 60 },
@@ -36,9 +36,9 @@ static const struct suffix_mult sfx[] = {
36int sleep_main(int argc, char **argv); 36int sleep_main(int argc, char **argv);
37int sleep_main(int argc, char **argv) 37int sleep_main(int argc, char **argv)
38{ 38{
39 unsigned int duration; 39 unsigned duration;
40 40
41#ifdef CONFIG_FEATURE_FANCY_SLEEP 41#if ENABLE_FEATURE_FANCY_SLEEP
42 42
43 if (argc < 2) { 43 if (argc < 2) {
44 bb_show_usage(); 44 bb_show_usage();
@@ -50,7 +50,7 @@ int sleep_main(int argc, char **argv)
50 duration += xatoul_range_sfx(*argv, 0, UINT_MAX-duration, sfx); 50 duration += xatoul_range_sfx(*argv, 0, UINT_MAX-duration, sfx);
51 } while (*++argv); 51 } while (*++argv);
52 52
53#else /* CONFIG_FEATURE_FANCY_SLEEP */ 53#else /* FEATURE_FANCY_SLEEP */
54 54
55 if (argc != 2) { 55 if (argc != 2) {
56 bb_show_usage(); 56 bb_show_usage();
@@ -58,7 +58,7 @@ int sleep_main(int argc, char **argv)
58 58
59 duration = xatou(argv[1]); 59 duration = xatou(argv[1]);
60 60
61#endif /* CONFIG_FEATURE_FANCY_SLEEP */ 61#endif /* FEATURE_FANCY_SLEEP */
62 62
63 if (sleep(duration)) { 63 if (sleep(duration)) {
64 bb_perror_nomsg_and_die(); 64 bb_perror_nomsg_and_die();