diff options
-rw-r--r-- | shell/hush.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/shell/hush.c b/shell/hush.c index f1d25a199..d0d983018 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -6735,13 +6735,17 @@ static void exec_builtin(char ***to_free, | |||
6735 | static void execvp_or_die(char **argv) NORETURN; | 6735 | static void execvp_or_die(char **argv) NORETURN; |
6736 | static void execvp_or_die(char **argv) | 6736 | static void execvp_or_die(char **argv) |
6737 | { | 6737 | { |
6738 | int e; | ||
6738 | debug_printf_exec("execing '%s'\n", argv[0]); | 6739 | debug_printf_exec("execing '%s'\n", argv[0]); |
6739 | /* Don't propagate SIG_IGN to the child */ | 6740 | /* Don't propagate SIG_IGN to the child */ |
6740 | if (SPECIAL_JOBSTOP_SIGS != 0) | 6741 | if (SPECIAL_JOBSTOP_SIGS != 0) |
6741 | switch_off_special_sigs(G.special_sig_mask & SPECIAL_JOBSTOP_SIGS); | 6742 | switch_off_special_sigs(G.special_sig_mask & SPECIAL_JOBSTOP_SIGS); |
6742 | execvp(argv[0], argv); | 6743 | execvp(argv[0], argv); |
6744 | e = 2; | ||
6745 | if (errno == EACCES) e = 126; | ||
6746 | if (errno == ENOENT) e = 127; | ||
6743 | bb_perror_msg("can't execute '%s'", argv[0]); | 6747 | bb_perror_msg("can't execute '%s'", argv[0]); |
6744 | _exit(127); /* bash compat */ | 6748 | _exit(e); |
6745 | } | 6749 | } |
6746 | 6750 | ||
6747 | #if ENABLE_HUSH_MODE_X | 6751 | #if ENABLE_HUSH_MODE_X |