diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2023-04-12 12:23:36 +0200 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2023-04-12 12:23:36 +0200 |
| commit | 550e6d8fbd05ea0ab60ff3e542327efb4e9cc254 (patch) | |
| tree | 608022cc2921332e4fb494073279f6ac8b02778b /coreutils | |
| parent | 478b5ac2bcdb5014d8e6a6e8d7647b4c599cc1a7 (diff) | |
| download | busybox-w32-550e6d8fbd05ea0ab60ff3e542327efb4e9cc254.tar.gz busybox-w32-550e6d8fbd05ea0ab60ff3e542327efb4e9cc254.tar.bz2 busybox-w32-550e6d8fbd05ea0ab60ff3e542327efb4e9cc254.zip | |
sleep: fix error exit when called as "sh" builtin
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'coreutils')
| -rw-r--r-- | coreutils/sleep.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/coreutils/sleep.c b/coreutils/sleep.c index 667db558d..a0cee5a4a 100644 --- a/coreutils/sleep.c +++ b/coreutils/sleep.c | |||
| @@ -74,7 +74,8 @@ int sleep_main(int argc UNUSED_PARAM, char **argv) | |||
| 74 | ++argv; | 74 | ++argv; |
| 75 | if (!*argv) { | 75 | if (!*argv) { |
| 76 | /* Without this, bare "sleep" in ash shows _ash_ --help */ | 76 | /* Without this, bare "sleep" in ash shows _ash_ --help */ |
| 77 | if (ENABLE_ASH_SLEEP && applet_name[0] != 's') { | 77 | /* (ash can be the "sh" applet as well, so check 2nd char) */ |
| 78 | if (ENABLE_ASH_SLEEP && applet_name[1] != 'l') { | ||
| 78 | bb_simple_error_msg("sleep: missing operand"); | 79 | bb_simple_error_msg("sleep: missing operand"); |
| 79 | return EXIT_FAILURE; | 80 | return EXIT_FAILURE; |
| 80 | } | 81 | } |
