diff options
author | Denis Vlasenko | 2007-04-10 15:43:37 +0000 |
---|---|---|
committer | Denis Vlasenko | 2007-04-10 15:43:37 +0000 |
commit | 99912ca733dd960f5589227fd999c86e73c8e894 (patch) | |
tree | 9df947fc08884d498cf76a02204d74b121064134 /coreutils/sleep.c | |
parent | ff131b980d524a33d8a43cefe65e14f64a43f2da (diff) | |
download | busybox-99912ca733dd960f5589227fd999c86e73c8e894.zip busybox-99912ca733dd960f5589227fd999c86e73c8e894.tar.gz |
audit small applets and mark some of them as NOFORK.
Put big scary warnings in relevant places.
Diffstat (limited to 'coreutils/sleep.c')
-rw-r--r-- | coreutils/sleep.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/coreutils/sleep.c b/coreutils/sleep.c index b89b0fe..592005b 100644 --- a/coreutils/sleep.c +++ b/coreutils/sleep.c @@ -18,12 +18,12 @@ * time suffixes for seconds, minutes, hours, and days. */ -#include <stdlib.h> -#include <limits.h> -#include <unistd.h> #include "busybox.h" -#ifdef CONFIG_FEATURE_FANCY_SLEEP +/* This is a NOFORK applet. Be very careful! */ + + +#if ENABLE_FEATURE_FANCY_SLEEP static const struct suffix_mult sfx[] = { { "s", 1 }, { "m", 60 }, @@ -36,9 +36,9 @@ static const struct suffix_mult sfx[] = { int sleep_main(int argc, char **argv); int sleep_main(int argc, char **argv) { - unsigned int duration; + unsigned duration; -#ifdef CONFIG_FEATURE_FANCY_SLEEP +#if ENABLE_FEATURE_FANCY_SLEEP if (argc < 2) { bb_show_usage(); @@ -50,7 +50,7 @@ int sleep_main(int argc, char **argv) duration += xatoul_range_sfx(*argv, 0, UINT_MAX-duration, sfx); } while (*++argv); -#else /* CONFIG_FEATURE_FANCY_SLEEP */ +#else /* FEATURE_FANCY_SLEEP */ if (argc != 2) { bb_show_usage(); @@ -58,7 +58,7 @@ int sleep_main(int argc, char **argv) duration = xatou(argv[1]); -#endif /* CONFIG_FEATURE_FANCY_SLEEP */ +#endif /* FEATURE_FANCY_SLEEP */ if (sleep(duration)) { bb_perror_nomsg_and_die(); |