sleep: support "inf"
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
4bdc914ff9
commit
edca770d11
@ -68,6 +68,11 @@ int sleep_main(int argc UNUSED_PARAM, char **argv)
|
|||||||
if (!*argv)
|
if (!*argv)
|
||||||
bb_show_usage();
|
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_FEATURE_FANCY_SLEEP
|
||||||
# if ENABLE_FLOAT_DURATION
|
# if ENABLE_FLOAT_DURATION
|
||||||
/* undo busybox.c setlocale */
|
/* undo busybox.c setlocale */
|
||||||
|
@ -7407,4 +7407,3 @@ int dc_main(int argc UNUSED_PARAM, char **argv)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // DC_BIG
|
#endif // DC_BIG
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user