diff options
Diffstat (limited to 'shell/ash.c')
-rw-r--r-- | shell/ash.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/shell/ash.c b/shell/ash.c index 430e42a7b..7c53946ce 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -1284,6 +1284,8 @@ ash_msg_and_raise_error(const char *msg, ...) | |||
1284 | { | 1284 | { |
1285 | va_list ap; | 1285 | va_list ap; |
1286 | 1286 | ||
1287 | exitstatus = 2; | ||
1288 | |||
1287 | va_start(ap, msg); | 1289 | va_start(ap, msg); |
1288 | ash_vmsg_and_raise(EXERROR, msg, ap); | 1290 | ash_vmsg_and_raise(EXERROR, msg, ap); |
1289 | /* NOTREACHED */ | 1291 | /* NOTREACHED */ |
@@ -9588,11 +9590,13 @@ evalcommand(union node *cmd, int flags) | |||
9588 | } | 9590 | } |
9589 | 9591 | ||
9590 | if (status) { | 9592 | if (status) { |
9593 | bail: | ||
9594 | exitstatus = status; | ||
9595 | |||
9591 | /* We have a redirection error. */ | 9596 | /* We have a redirection error. */ |
9592 | if (spclbltin > 0) | 9597 | if (spclbltin > 0) |
9593 | raise_exception(EXERROR); | 9598 | raise_exception(EXERROR); |
9594 | bail: | 9599 | |
9595 | exitstatus = status; | ||
9596 | goto out; | 9600 | goto out; |
9597 | } | 9601 | } |
9598 | 9602 | ||