audit small applets and mark some of them as NOFORK.
Put big scary warnings in relevant places.
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 @@
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 @@
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 @@
duration = xatou(argv[1]);
-#endif /* CONFIG_FEATURE_FANCY_SLEEP */
+#endif /* FEATURE_FANCY_SLEEP */
if (sleep(duration)) {
bb_perror_nomsg_and_die();