summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko2019-01-07 15:20:56 +0100
committerDenys Vlasenko2019-01-07 15:20:56 +0100
commitedca770d11edcc5b5548a62c068b2e75f1ccb54a (patch)
tree8e284e94e4fb4717a828b0b87290c6bb6b2ee9e6
parent4bdc914ff97df0cea8d2c7b42bf7f57d5ebb8dcb (diff)
downloadbusybox-edca770d11edcc5b5548a62c068b2e75f1ccb54a.zip
busybox-edca770d11edcc5b5548a62c068b2e75f1ccb54a.tar.gz
sleep: support "inf"
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--coreutils/sleep.c5
-rw-r--r--miscutils/bc.c1
2 files changed, 5 insertions, 1 deletions
diff --git a/coreutils/sleep.c b/coreutils/sleep.c
index 5c9cda9..7bfaab9 100644
--- a/coreutils/sleep.c
+++ b/coreutils/sleep.c
@@ -68,6 +68,11 @@ int sleep_main(int argc UNUSED_PARAM, char **argv)
if (!*argv)
bb_show_usage();
+ /* GNU sleep accepts "inf", "INF", "infinity" and "INFINITY" */
+ if (strncasecmp(argv[0], "inf", 3) == 0)
+ for (;;)
+ sleep(INT_MAX);
+
#if ENABLE_FEATURE_FANCY_SLEEP
# if ENABLE_FLOAT_DURATION
/* undo busybox.c setlocale */
diff --git a/miscutils/bc.c b/miscutils/bc.c
index 7488455..bf174da 100644
--- a/miscutils/bc.c
+++ b/miscutils/bc.c
@@ -7407,4 +7407,3 @@ int dc_main(int argc UNUSED_PARAM, char **argv)
#endif
#endif // DC_BIG
-