diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-06-23 22:31:52 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-06-23 22:31:52 +0000 |
commit | cc3f20b9bdf9a46c41877dab4900eb2997b72019 (patch) | |
tree | 4447fc490a0f65921d5c324283da20c837121535 /shell | |
parent | 211b59be431350b2cc6685f5365ad5e6b597dc18 (diff) | |
download | busybox-w32-cc3f20b9bdf9a46c41877dab4900eb2997b72019.tar.gz busybox-w32-cc3f20b9bdf9a46c41877dab4900eb2997b72019.tar.bz2 busybox-w32-cc3f20b9bdf9a46c41877dab4900eb2997b72019.zip |
fix breakage found by randomconfig
Diffstat (limited to 'shell')
-rw-r--r-- | shell/ash.c | 2 | ||||
-rw-r--r-- | shell/hush.c | 13 |
2 files changed, 8 insertions, 7 deletions
diff --git a/shell/ash.c b/shell/ash.c index d4da391a0..dd20fe338 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -8983,7 +8983,7 @@ preadfd(void) | |||
8983 | } | 8983 | } |
8984 | } | 8984 | } |
8985 | #else | 8985 | #else |
8986 | nr = nonblock_safe_read(parsefile->fd, buf, BUFSIZ - 1); | 8986 | nr = nonblock_safe_read(g_parsefile->fd, buf, BUFSIZ - 1); |
8987 | #endif | 8987 | #endif |
8988 | 8988 | ||
8989 | #if 0 | 8989 | #if 0 |
diff --git a/shell/hush.c b/shell/hush.c index 02eae7d5b..01c9dc8ef 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -399,11 +399,11 @@ struct globals { | |||
399 | #if ENABLE_FEATURE_EDITING | 399 | #if ENABLE_FEATURE_EDITING |
400 | line_input_t *line_input_state; | 400 | line_input_t *line_input_state; |
401 | #endif | 401 | #endif |
402 | pid_t root_pid; | ||
402 | #if ENABLE_HUSH_JOB | 403 | #if ENABLE_HUSH_JOB |
403 | int run_list_level; | 404 | int run_list_level; |
404 | pid_t saved_task_pgrp; | 405 | pid_t saved_task_pgrp; |
405 | pid_t saved_tty_pgrp; | 406 | pid_t saved_tty_pgrp; |
406 | pid_t root_pid; | ||
407 | int last_jobid; | 407 | int last_jobid; |
408 | struct pipe *job_list; | 408 | struct pipe *job_list; |
409 | struct pipe *toplevel_list; | 409 | struct pipe *toplevel_list; |
@@ -446,11 +446,11 @@ enum { run_list_level = 0 }; | |||
446 | #if ENABLE_FEATURE_EDITING | 446 | #if ENABLE_FEATURE_EDITING |
447 | #define line_input_state (G.line_input_state) | 447 | #define line_input_state (G.line_input_state) |
448 | #endif | 448 | #endif |
449 | #define root_pid (G.root_pid ) | ||
449 | #if ENABLE_HUSH_JOB | 450 | #if ENABLE_HUSH_JOB |
450 | #define run_list_level (G.run_list_level ) | 451 | #define run_list_level (G.run_list_level ) |
451 | #define saved_task_pgrp (G.saved_task_pgrp ) | 452 | #define saved_task_pgrp (G.saved_task_pgrp ) |
452 | #define saved_tty_pgrp (G.saved_tty_pgrp ) | 453 | #define saved_tty_pgrp (G.saved_tty_pgrp ) |
453 | #define root_pid (G.root_pid ) | ||
454 | #define last_jobid (G.last_jobid ) | 454 | #define last_jobid (G.last_jobid ) |
455 | #define job_list (G.job_list ) | 455 | #define job_list (G.job_list ) |
456 | #define toplevel_list (G.toplevel_list ) | 456 | #define toplevel_list (G.toplevel_list ) |
@@ -1065,7 +1065,7 @@ static int o_save_ptr_helper(o_string *o, int n) | |||
1065 | debug_printf_list("list[%d]=%d string_start=%d (empty slot)\n", n, string_len, string_start); | 1065 | debug_printf_list("list[%d]=%d string_start=%d (empty slot)\n", n, string_len, string_start); |
1066 | o->has_empty_slot = 0; | 1066 | o->has_empty_slot = 0; |
1067 | } | 1067 | } |
1068 | list[n] = (char*)string_len; | 1068 | list[n] = (char*)(ptrdiff_t)string_len; |
1069 | return n + 1; | 1069 | return n + 1; |
1070 | } | 1070 | } |
1071 | 1071 | ||
@@ -1075,7 +1075,7 @@ static int o_get_last_ptr(o_string *o, int n) | |||
1075 | char **list = (char**)o->data; | 1075 | char **list = (char**)o->data; |
1076 | int string_start = ((n + 0xf) & ~0xf) * sizeof(list[0]); | 1076 | int string_start = ((n + 0xf) & ~0xf) * sizeof(list[0]); |
1077 | 1077 | ||
1078 | return ((int)list[n-1]) + string_start; | 1078 | return ((int)(ptrdiff_t)list[n-1]) + string_start; |
1079 | } | 1079 | } |
1080 | 1080 | ||
1081 | /* o_glob performs globbing on last list[], saving each result | 1081 | /* o_glob performs globbing on last list[], saving each result |
@@ -1152,7 +1152,7 @@ static char **o_finalize_list(o_string *o, int n) | |||
1152 | list[--n] = NULL; | 1152 | list[--n] = NULL; |
1153 | while (n) { | 1153 | while (n) { |
1154 | n--; | 1154 | n--; |
1155 | list[n] = o->data + (int)list[n] + string_start; | 1155 | list[n] = o->data + (int)(ptrdiff_t)list[n] + string_start; |
1156 | } | 1156 | } |
1157 | return list; | 1157 | return list; |
1158 | } | 1158 | } |
@@ -2012,6 +2012,7 @@ static int run_list(struct pipe *pi) | |||
2012 | #else | 2012 | #else |
2013 | enum { if_code = 0, next_if_code = 0 }; | 2013 | enum { if_code = 0, next_if_code = 0 }; |
2014 | #endif | 2014 | #endif |
2015 | // TODO: rword and ->res_word are not needed if !LOOPS and !IF | ||
2015 | reserved_style rword; | 2016 | reserved_style rword; |
2016 | reserved_style skip_more_for_this_rword = RES_XXXX; | 2017 | reserved_style skip_more_for_this_rword = RES_XXXX; |
2017 | 2018 | ||
@@ -3009,7 +3010,7 @@ static void done_pipe(struct p_context *ctx, pipe_style type) | |||
3009 | * IOW: it is safe to do it unconditionally. | 3010 | * IOW: it is safe to do it unconditionally. |
3010 | * RES_IN case is for "for a in; do ..." (empty IN set) | 3011 | * RES_IN case is for "for a in; do ..." (empty IN set) |
3011 | * to work. */ | 3012 | * to work. */ |
3012 | if (not_null || ctx->pipe->res_word == RES_IN) { | 3013 | if (not_null USE_HUSH_LOOPS(|| ctx->pipe->res_word == RES_IN)) { |
3013 | struct pipe *new_p = new_pipe(); | 3014 | struct pipe *new_p = new_pipe(); |
3014 | ctx->pipe->next = new_p; | 3015 | ctx->pipe->next = new_p; |
3015 | ctx->pipe = new_p; | 3016 | ctx->pipe = new_p; |