aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--shell/ash.c3
-rw-r--r--shell/hush.c2
2 files changed, 3 insertions, 2 deletions
diff --git a/shell/ash.c b/shell/ash.c
index d9595bb8f..9798a9675 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -10234,6 +10234,7 @@ setinputfile(const char *fname, int flags)
if (fd < 0) {
if (flags & INPUT_NOFILE_OK)
goto out;
+ exitstatus = 127;
ash_msg_and_raise_error("can't open '%s'", fname);
}
if (fd < 10) {
@@ -13403,8 +13404,6 @@ int ash_main(int argc UNUSED_PARAM, char **argv)
reset();
e = exception_type;
- if (e == EXERROR)
- exitstatus = 2;
s = state;
if (e == EXEXIT || s == 0 || iflag == 0 || shlvl) {
exitshell();
diff --git a/shell/hush.c b/shell/hush.c
index 9b51f389e..d7a0d761e 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -8409,7 +8409,9 @@ int hush_main(int argc, char **argv)
G.global_argc--;
G.global_argv++;
debug_printf("running script '%s'\n", G.global_argv[0]);
+ xfunc_error_retval = 127; /* for "hush /does/not/exist" case */
input = xfopen_for_read(G.global_argv[0]);
+ xfunc_error_retval = 1;
remember_FILE(input);
install_special_sighandlers();
parse_and_run_file(input);