aboutsummaryrefslogtreecommitdiff
path: root/coreutils/sleep.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2019-01-07 15:20:56 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2019-01-07 15:20:56 +0100
commitedca770d11edcc5b5548a62c068b2e75f1ccb54a (patch)
tree8e284e94e4fb4717a828b0b87290c6bb6b2ee9e6 /coreutils/sleep.c
parent4bdc914ff97df0cea8d2c7b42bf7f57d5ebb8dcb (diff)
downloadbusybox-w32-edca770d11edcc5b5548a62c068b2e75f1ccb54a.tar.gz
busybox-w32-edca770d11edcc5b5548a62c068b2e75f1ccb54a.tar.bz2
busybox-w32-edca770d11edcc5b5548a62c068b2e75f1ccb54a.zip
sleep: support "inf"
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'coreutils/sleep.c')
-rw-r--r--coreutils/sleep.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/coreutils/sleep.c b/coreutils/sleep.c
index 5c9cda9f0..7bfaab920 100644
--- a/coreutils/sleep.c
+++ b/coreutils/sleep.c
@@ -68,6 +68,11 @@ int sleep_main(int argc UNUSED_PARAM, char **argv)
68 if (!*argv) 68 if (!*argv)
69 bb_show_usage(); 69 bb_show_usage();
70 70
71 /* GNU sleep accepts "inf", "INF", "infinity" and "INFINITY" */
72 if (strncasecmp(argv[0], "inf", 3) == 0)
73 for (;;)
74 sleep(INT_MAX);
75
71#if ENABLE_FEATURE_FANCY_SLEEP 76#if ENABLE_FEATURE_FANCY_SLEEP
72# if ENABLE_FLOAT_DURATION 77# if ENABLE_FLOAT_DURATION
73 /* undo busybox.c setlocale */ 78 /* undo busybox.c setlocale */