diff options
author | Ron Yorston <rmy@pobox.com> | 2015-10-30 19:06:47 +0000 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2015-10-30 22:19:48 +0100 |
commit | 8c55dc79a79d6a16c364e6b1f849bf426f21fcbb (patch) | |
tree | c3d16eb9648a81286ab20727b32b61a17f76f63b | |
parent | e939856c8724e357b3a7ba878563bfc957605504 (diff) | |
download | busybox-w32-8c55dc79a79d6a16c364e6b1f849bf426f21fcbb.tar.gz busybox-w32-8c55dc79a79d6a16c364e6b1f849bf426f21fcbb.tar.bz2 busybox-w32-8c55dc79a79d6a16c364e6b1f849bf426f21fcbb.zip |
ash: fix EXEXEC status clobbering
evalcommand always clobbers the exit status in case of an EXEXEC
which means that exec always fails with exit status 2 regardless
of what it actually returns.
This patch adds the missing check for EXEXEC so that the correct
exit status is preserved. It causes the test ash-misc/exec.tests
to succeed.
Based on commit 7f68426 in dash git, by Herbert Xu.
Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | shell/ash.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/shell/ash.c b/shell/ash.c index 9a8bab5ab..c333b235b 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -9432,7 +9432,7 @@ evalcommand(union node *cmd, int flags) | |||
9432 | if (evalbltin(cmdentry.u.cmd, argc, argv)) { | 9432 | if (evalbltin(cmdentry.u.cmd, argc, argv)) { |
9433 | int exit_status; | 9433 | int exit_status; |
9434 | int i = exception_type; | 9434 | int i = exception_type; |
9435 | if (i == EXEXIT) | 9435 | if (i == EXEXIT || i == EXEXEC) |
9436 | goto raise; | 9436 | goto raise; |
9437 | exit_status = 2; | 9437 | exit_status = 2; |
9438 | if (i == EXINT) | 9438 | if (i == EXINT) |