diff options
author | Denys Vlasenko | 2023-07-10 10:52:41 +0200 |
---|---|---|
committer | Denys Vlasenko | 2023-07-10 10:53:23 +0200 |
commit | 5e0411a7fb510b9aecda0a850c76bdd62c50efa4 (patch) | |
tree | d3698f53c76998c940131e18aca0cf5e025c6605 /shell | |
parent | 6ce1dc2e91398145633ceaff7a6fecc786826277 (diff) | |
download | busybox-5e0411a7fb510b9aecda0a850c76bdd62c50efa4.zip busybox-5e0411a7fb510b9aecda0a850c76bdd62c50efa4.tar.gz |
ash: disable sleep as builtin, closes 15619
Has a few annoying problems:
* sleepcmd() -> sleep_main(), the parsing of bad arguments exits the shell.
* sleep_for_duration() in sleep_main() has to be interruptible for
^C traps to work, which may be a problem for other users
of sleep_for_duration().
* BUT, if sleep_for_duration() is interruptible, then SIGCHLD interrupts it
as well (try "/bin/sleep 1 & sleep 10").
* sleep_main() must not allocate anything as ^C in ash longjmp's.
(currently, allocations are only on error paths, in message printing).
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell')
-rw-r--r-- | shell/ash.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/shell/ash.c b/shell/ash.c index e915669..e154cc6 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -134,11 +134,23 @@ //config: default y //config: depends on SHELL_ASH //config: -//config:config ASH_SLEEP -//config: bool "sleep builtin" -//config: default y -//config: depends on SHELL_ASH -//config: +// +////config:config ASH_SLEEP +////config: bool "sleep builtin" +////config: default y +////config: depends on SHELL_ASH +////config: +//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +//Disabled for now. Has a few annoying problems: +// * sleepcmd() -> sleep_main(), the parsing of bad arguments exits the shell. +// * sleep_for_duration() in sleep_main() has to be interruptible for +// ^C traps to work, which may be a problem for other users +// of sleep_for_duration(). +// * BUT, if sleep_for_duration() is interruptible, then SIGCHLD interrupts it +// as well (try "/bin/sleep 1 & sleep 10"). +// * sleep_main() must not allocate anything as ^C in ash longjmp's. +// (currently, allocations are only on error paths, in message printing). +// //config:config ASH_HELP //config: bool "help builtin" //config: default y |