diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-05-20 21:52:49 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-05-20 21:52:49 +0000 |
commit | 262d7653514f2b94c3aea4dac31b09e46b8b1c15 (patch) | |
tree | 7ed0757900c01515ac87a08ddc9f1b4c2b1ea6b7 /shell | |
parent | 14b5dd9943d7873d5184c64236b37407bff9baaa (diff) | |
download | busybox-w32-262d7653514f2b94c3aea4dac31b09e46b8b1c15.tar.gz busybox-w32-262d7653514f2b94c3aea4dac31b09e46b8b1c15.tar.bz2 busybox-w32-262d7653514f2b94c3aea4dac31b09e46b8b1c15.zip |
hush: trivial size optimization
Diffstat (limited to 'shell')
-rw-r--r-- | shell/hush.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/shell/hush.c b/shell/hush.c index 9c7fc8645..0d260a762 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -229,14 +229,15 @@ struct child_prog { | |||
229 | pid_t pid; /* 0 if exited */ | 229 | pid_t pid; /* 0 if exited */ |
230 | char **argv; /* program name and arguments */ | 230 | char **argv; /* program name and arguments */ |
231 | struct pipe *group; /* if non-NULL, first in group or subshell */ | 231 | struct pipe *group; /* if non-NULL, first in group or subshell */ |
232 | int subshell; /* flag, non-zero if group must be forked */ | 232 | smallint subshell; /* flag, non-zero if group must be forked */ |
233 | smallint is_stopped; /* is the program currently running? */ | ||
233 | struct redir_struct *redirects; /* I/O redirections */ | 234 | struct redir_struct *redirects; /* I/O redirections */ |
234 | glob_t glob_result; /* result of parameter globbing */ | 235 | glob_t glob_result; /* result of parameter globbing */ |
235 | int is_stopped; /* is the program currently running? */ | ||
236 | struct pipe *family; /* pointer back to the child's parent pipe */ | 236 | struct pipe *family; /* pointer back to the child's parent pipe */ |
237 | //sp counting seems to be broken... so commented out, grep for '//sp:' | 237 | //sp counting seems to be broken... so commented out, grep for '//sp:' |
238 | //sp: int sp; /* number of SPECIAL_VAR_SYMBOL */ | 238 | //sp: int sp; /* number of SPECIAL_VAR_SYMBOL */ |
239 | int type; | 239 | //seems to be unused, grep for '//pt:' |
240 | //pt: int parse_type; | ||
240 | }; | 241 | }; |
241 | /* argv vector may contain variable references (^Cvar^C, ^C0^C etc) | 242 | /* argv vector may contain variable references (^Cvar^C, ^C0^C etc) |
242 | * and on execution these are substituted with their values. | 243 | * and on execution these are substituted with their values. |
@@ -2969,7 +2970,7 @@ static int done_command(struct p_context *ctx) | |||
2969 | /*child->glob_result.gl_pathv = NULL;*/ | 2970 | /*child->glob_result.gl_pathv = NULL;*/ |
2970 | child->family = pi; | 2971 | child->family = pi; |
2971 | //sp: /*child->sp = 0;*/ | 2972 | //sp: /*child->sp = 0;*/ |
2972 | child->type = ctx->parse_type; | 2973 | //pt: child->parse_type = ctx->parse_type; |
2973 | 2974 | ||
2974 | ctx->child = child; | 2975 | ctx->child = child; |
2975 | /* but ctx->pipe and ctx->list_head remain unchanged */ | 2976 | /* but ctx->pipe and ctx->list_head remain unchanged */ |
@@ -3125,7 +3126,7 @@ static int process_command_subs(o_string *dest, struct p_context *ctx, | |||
3125 | debug_printf("done reading from pipe, pclose()ing\n"); | 3126 | debug_printf("done reading from pipe, pclose()ing\n"); |
3126 | /* This is the step that wait()s for the child. Should be pretty | 3127 | /* This is the step that wait()s for the child. Should be pretty |
3127 | * safe, since we just read an EOF from its stdout. We could try | 3128 | * safe, since we just read an EOF from its stdout. We could try |
3128 | * to better, by using wait(), and keeping track of background jobs | 3129 | * to do better, by using wait(), and keeping track of background jobs |
3129 | * at the same time. That would be a lot of work, and contrary | 3130 | * at the same time. That would be a lot of work, and contrary |
3130 | * to the KISS philosophy of this program. */ | 3131 | * to the KISS philosophy of this program. */ |
3131 | mark_closed(fileno(p)); | 3132 | mark_closed(fileno(p)); |