diff options
Diffstat (limited to 'shell/hush.c')
-rw-r--r-- | shell/hush.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/shell/hush.c b/shell/hush.c index f82747f74..19b97e2a5 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -1398,7 +1398,7 @@ static void syntax_error(unsigned lineno UNUSED_PARAM, const char *msg) | |||
1398 | if (msg) | 1398 | if (msg) |
1399 | bb_error_msg("syntax error: %s", msg); | 1399 | bb_error_msg("syntax error: %s", msg); |
1400 | else | 1400 | else |
1401 | bb_error_msg("syntax error"); | 1401 | bb_simple_error_msg("syntax error"); |
1402 | die_if_script(); | 1402 | die_if_script(); |
1403 | } | 1403 | } |
1404 | 1404 | ||
@@ -1637,7 +1637,7 @@ static int refill_HFILE_and_getc(HFILE *fp) | |||
1637 | fp->cur = fp->buf; | 1637 | fp->cur = fp->buf; |
1638 | n = safe_read(fp->fd, fp->buf, sizeof(fp->buf)); | 1638 | n = safe_read(fp->fd, fp->buf, sizeof(fp->buf)); |
1639 | if (n < 0) { | 1639 | if (n < 0) { |
1640 | bb_perror_msg("read error"); | 1640 | bb_simple_perror_msg("read error"); |
1641 | n = 0; | 1641 | n = 0; |
1642 | } | 1642 | } |
1643 | fp->end = fp->buf + n; | 1643 | fp->end = fp->buf + n; |
@@ -2282,7 +2282,7 @@ static int set_local_var(char *str, unsigned flags) | |||
2282 | 2282 | ||
2283 | eq_sign = strchr(str, '='); | 2283 | eq_sign = strchr(str, '='); |
2284 | if (HUSH_DEBUG && !eq_sign) | 2284 | if (HUSH_DEBUG && !eq_sign) |
2285 | bb_error_msg_and_die("BUG in setvar"); | 2285 | bb_simple_error_msg_and_die("BUG in setvar"); |
2286 | 2286 | ||
2287 | name_len = eq_sign - str + 1; /* including '=' */ | 2287 | name_len = eq_sign - str + 1; /* including '=' */ |
2288 | cur_pp = &G.top_var; | 2288 | cur_pp = &G.top_var; |
@@ -2505,7 +2505,7 @@ static void set_vars_and_save_old(char **strings) | |||
2505 | 2505 | ||
2506 | eq = strchr(*s, '='); | 2506 | eq = strchr(*s, '='); |
2507 | if (HUSH_DEBUG && !eq) | 2507 | if (HUSH_DEBUG && !eq) |
2508 | bb_error_msg_and_die("BUG in varexp4"); | 2508 | bb_simple_error_msg_and_die("BUG in varexp4"); |
2509 | var_pp = get_ptr_to_local_var(*s, eq - *s); | 2509 | var_pp = get_ptr_to_local_var(*s, eq - *s); |
2510 | if (var_pp) { | 2510 | if (var_pp) { |
2511 | var_p = *var_pp; | 2511 | var_p = *var_pp; |
@@ -4246,7 +4246,7 @@ static int parse_redir_right_fd(o_string *as_string, struct in_str *input) | |||
4246 | 4246 | ||
4247 | //TODO: this is the place to catch ">&file" bashism (redirect both fd 1 and 2) | 4247 | //TODO: this is the place to catch ">&file" bashism (redirect both fd 1 and 2) |
4248 | 4248 | ||
4249 | bb_error_msg("ambiguous redirect"); | 4249 | bb_simple_error_msg("ambiguous redirect"); |
4250 | return REDIRFD_SYNTAX_ERR; | 4250 | return REDIRFD_SYNTAX_ERR; |
4251 | } | 4251 | } |
4252 | 4252 | ||
@@ -6956,7 +6956,7 @@ static char *expand_string_to_string(const char *str, int EXP_flags, int do_unba | |||
6956 | } else { | 6956 | } else { |
6957 | if (HUSH_DEBUG) | 6957 | if (HUSH_DEBUG) |
6958 | if (list[1]) | 6958 | if (list[1]) |
6959 | bb_error_msg_and_die("BUG in varexp2"); | 6959 | bb_simple_error_msg_and_die("BUG in varexp2"); |
6960 | /* actually, just move string 2*sizeof(char*) bytes back */ | 6960 | /* actually, just move string 2*sizeof(char*) bytes back */ |
6961 | overlapping_strcpy((char*)list, list[0]); | 6961 | overlapping_strcpy((char*)list, list[0]); |
6962 | if (do_unbackslash) | 6962 | if (do_unbackslash) |
@@ -7217,7 +7217,7 @@ static void re_execute_shell(char ***to_free, const char *s, | |||
7217 | if (argv[0][0] == '/') | 7217 | if (argv[0][0] == '/') |
7218 | execve(argv[0], argv, pp); | 7218 | execve(argv[0], argv, pp); |
7219 | xfunc_error_retval = 127; | 7219 | xfunc_error_retval = 127; |
7220 | bb_error_msg_and_die("can't re-execute the shell"); | 7220 | bb_simple_error_msg_and_die("can't re-execute the shell"); |
7221 | } | 7221 | } |
7222 | #endif /* !BB_MMU */ | 7222 | #endif /* !BB_MMU */ |
7223 | 7223 | ||
@@ -7919,7 +7919,7 @@ static void leave_var_nest_level(void) | |||
7919 | G.var_nest_level--; | 7919 | G.var_nest_level--; |
7920 | debug_printf_env("var_nest_level-- %u\n", G.var_nest_level); | 7920 | debug_printf_env("var_nest_level-- %u\n", G.var_nest_level); |
7921 | if (HUSH_DEBUG && (int)G.var_nest_level < 0) | 7921 | if (HUSH_DEBUG && (int)G.var_nest_level < 0) |
7922 | bb_error_msg_and_die("BUG: nesting underflow"); | 7922 | bb_simple_error_msg_and_die("BUG: nesting underflow"); |
7923 | 7923 | ||
7924 | remove_nested_vars(); | 7924 | remove_nested_vars(); |
7925 | } | 7925 | } |
@@ -8776,7 +8776,7 @@ static int checkjobs(struct pipe *fg_pipe, pid_t waitfor_pid) | |||
8776 | childpid = waitpid(-1, &status, attributes); | 8776 | childpid = waitpid(-1, &status, attributes); |
8777 | if (childpid <= 0) { | 8777 | if (childpid <= 0) { |
8778 | if (childpid && errno != ECHILD) | 8778 | if (childpid && errno != ECHILD) |
8779 | bb_perror_msg("waitpid"); | 8779 | bb_simple_perror_msg("waitpid"); |
8780 | #if ENABLE_HUSH_FAST | 8780 | #if ENABLE_HUSH_FAST |
8781 | else { /* Until next SIGCHLD, waitpid's are useless */ | 8781 | else { /* Until next SIGCHLD, waitpid's are useless */ |
8782 | G.we_have_children = (childpid == 0); | 8782 | G.we_have_children = (childpid == 0); |
@@ -9308,7 +9308,7 @@ static NOINLINE int run_pipe(struct pipe *pi) | |||
9308 | argv_expanded = NULL; | 9308 | argv_expanded = NULL; |
9309 | if (command->pid < 0) { /* [v]fork failed */ | 9309 | if (command->pid < 0) { /* [v]fork failed */ |
9310 | /* Clearly indicate, was it fork or vfork */ | 9310 | /* Clearly indicate, was it fork or vfork */ |
9311 | bb_perror_msg(BB_MMU ? "vfork"+1 : "vfork"); | 9311 | bb_simple_perror_msg(BB_MMU ? "vfork"+1 : "vfork"); |
9312 | } else { | 9312 | } else { |
9313 | pi->alive_cmds++; | 9313 | pi->alive_cmds++; |
9314 | #if ENABLE_HUSH_JOB | 9314 | #if ENABLE_HUSH_JOB |
@@ -10617,7 +10617,7 @@ static int FAST_FUNC builtin_read(char **argv) | |||
10617 | } | 10617 | } |
10618 | 10618 | ||
10619 | if ((uintptr_t)r > 1) { | 10619 | if ((uintptr_t)r > 1) { |
10620 | bb_error_msg("%s", r); | 10620 | bb_simple_error_msg(r); |
10621 | r = (char*)(uintptr_t)1; | 10621 | r = (char*)(uintptr_t)1; |
10622 | } | 10622 | } |
10623 | 10623 | ||
@@ -10862,7 +10862,7 @@ static int FAST_FUNC builtin_unset(char **argv) | |||
10862 | if (opts == (unsigned)-1) | 10862 | if (opts == (unsigned)-1) |
10863 | return EXIT_FAILURE; | 10863 | return EXIT_FAILURE; |
10864 | if (opts == 3) { | 10864 | if (opts == 3) { |
10865 | bb_error_msg("unset: -v and -f are exclusive"); | 10865 | bb_simple_error_msg("unset: -v and -f are exclusive"); |
10866 | return EXIT_FAILURE; | 10866 | return EXIT_FAILURE; |
10867 | } | 10867 | } |
10868 | argv += optind; | 10868 | argv += optind; |
@@ -11025,7 +11025,7 @@ Test that VAR is a valid variable name? | |||
11025 | 11025 | ||
11026 | optstring = *++argv; | 11026 | optstring = *++argv; |
11027 | if (!optstring || !(var = *++argv)) { | 11027 | if (!optstring || !(var = *++argv)) { |
11028 | bb_error_msg("usage: getopts OPTSTRING VAR [ARGS]"); | 11028 | bb_simple_error_msg("usage: getopts OPTSTRING VAR [ARGS]"); |
11029 | return EXIT_FAILURE; | 11029 | return EXIT_FAILURE; |
11030 | } | 11030 | } |
11031 | 11031 | ||
@@ -11254,7 +11254,7 @@ static int FAST_FUNC builtin_trap(char **argv) | |||
11254 | } | 11254 | } |
11255 | 11255 | ||
11256 | if (!argv[1]) { /* no second arg */ | 11256 | if (!argv[1]) { /* no second arg */ |
11257 | bb_error_msg("trap: invalid arguments"); | 11257 | bb_simple_error_msg("trap: invalid arguments"); |
11258 | return EXIT_FAILURE; | 11258 | return EXIT_FAILURE; |
11259 | } | 11259 | } |
11260 | 11260 | ||
@@ -11295,7 +11295,7 @@ static struct pipe *parse_jobspec(const char *str) | |||
11295 | /* It is "%%", "%+" or "%" - current job */ | 11295 | /* It is "%%", "%+" or "%" - current job */ |
11296 | jobnum = G.last_jobid; | 11296 | jobnum = G.last_jobid; |
11297 | if (jobnum == 0) { | 11297 | if (jobnum == 0) { |
11298 | bb_error_msg("no current job"); | 11298 | bb_simple_error_msg("no current job"); |
11299 | return NULL; | 11299 | return NULL; |
11300 | } | 11300 | } |
11301 | } | 11301 | } |
@@ -11372,7 +11372,7 @@ static int FAST_FUNC builtin_fg_bg(char **argv) | |||
11372 | delete_finished_job(pi); | 11372 | delete_finished_job(pi); |
11373 | return EXIT_SUCCESS; | 11373 | return EXIT_SUCCESS; |
11374 | } | 11374 | } |
11375 | bb_perror_msg("kill (SIGCONT)"); | 11375 | bb_simple_perror_msg("kill (SIGCONT)"); |
11376 | } | 11376 | } |
11377 | 11377 | ||
11378 | if (argv[0][0] == 'f') { | 11378 | if (argv[0][0] == 'f') { |