[git commit] ash: fix EXEXEC status clobbering
Denys Vlasenko
vda.linux at googlemail.com
Fri Oct 30 21:19:48 UTC 2015
commit: http://git.busybox.net/busybox/commit/?id=8c55dc79a79d6a16c364e6b1f849bf426f21fcbb
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master
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 at pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
shell/ash.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/shell/ash.c b/shell/ash.c
index 9a8bab5..c333b23 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -9432,7 +9432,7 @@ evalcommand(union node *cmd, int flags)
if (evalbltin(cmdentry.u.cmd, argc, argv)) {
int exit_status;
int i = exception_type;
- if (i == EXEXIT)
+ if (i == EXEXIT || i == EXEXEC)
goto raise;
exit_status = 2;
if (i == EXINT)
More information about the busybox-cvs
mailing list