aboutsummaryrefslogtreecommitdiff
path: root/shell/hush.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2011-02-02 18:38:57 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2011-02-02 18:38:57 +0100
commitb72baeb00328576df415f9a4b4f3d5f202e3be11 (patch)
treec6863cb112e6e33908e17f298d541c1b0c3aa418 /shell/hush.c
parentc71b469f5daceb717e31cc9ce46b0e058e2c57b6 (diff)
downloadbusybox-w32-b72baeb00328576df415f9a4b4f3d5f202e3be11.tar.gz
busybox-w32-b72baeb00328576df415f9a4b4f3d5f202e3be11.tar.bz2
busybox-w32-b72baeb00328576df415f9a4b4f3d5f202e3be11.zip
hush: use FEATURE_SH_NOFORK to enable NOFORK trick
Also expands docs Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/hush.c')
-rw-r--r--shell/hush.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/shell/hush.c b/shell/hush.c
index 1709fd9d1..10788b8e7 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -6615,7 +6615,7 @@ static int checkjobs_and_fg_shell(struct pipe *fg_pipe)
6615 * cmd ; ... { list } ; ... 6615 * cmd ; ... { list } ; ...
6616 * cmd && ... { list } && ... 6616 * cmd && ... { list } && ...
6617 * cmd || ... { list } || ... 6617 * cmd || ... { list } || ...
6618 * If it is, then we can run cmd as a builtin, NOFORK [do we do this?], 6618 * If it is, then we can run cmd as a builtin, NOFORK,
6619 * or (if SH_STANDALONE) an applet, and we can run the { list } 6619 * or (if SH_STANDALONE) an applet, and we can run the { list }
6620 * with run_list. If it isn't one of these, we fork and exec cmd. 6620 * with run_list. If it isn't one of these, we fork and exec cmd.
6621 * 6621 *
@@ -6797,13 +6797,12 @@ static NOINLINE int run_pipe(struct pipe *pi)
6797 } 6797 }
6798 6798
6799 /* Expand the rest into (possibly) many strings each */ 6799 /* Expand the rest into (possibly) many strings each */
6800 if (0) {}
6801#if ENABLE_HUSH_BASH_COMPAT 6800#if ENABLE_HUSH_BASH_COMPAT
6802 else if (command->cmd_type == CMD_SINGLEWORD_NOGLOB) { 6801 if (command->cmd_type == CMD_SINGLEWORD_NOGLOB) {
6803 argv_expanded = expand_strvec_to_strvec_singleword_noglob(argv + command->assignment_cnt); 6802 argv_expanded = expand_strvec_to_strvec_singleword_noglob(argv + command->assignment_cnt);
6804 } 6803 } else
6805#endif 6804#endif
6806 else { 6805 {
6807 argv_expanded = expand_strvec_to_strvec(argv + command->assignment_cnt); 6806 argv_expanded = expand_strvec_to_strvec(argv + command->assignment_cnt);
6808 } 6807 }
6809 6808
@@ -6865,7 +6864,7 @@ static NOINLINE int run_pipe(struct pipe *pi)
6865 return rcode; 6864 return rcode;
6866 } 6865 }
6867 6866
6868 if (ENABLE_FEATURE_SH_STANDALONE) { 6867 if (ENABLE_FEATURE_SH_NOFORK) {
6869 int n = find_applet_by_name(argv_expanded[0]); 6868 int n = find_applet_by_name(argv_expanded[0]);
6870 if (n >= 0 && APPLET_IS_NOFORK(n)) { 6869 if (n >= 0 && APPLET_IS_NOFORK(n)) {
6871 rcode = redirect_and_varexp_helper(&new_env, &old_vars, command, squirrel, argv_expanded); 6870 rcode = redirect_and_varexp_helper(&new_env, &old_vars, command, squirrel, argv_expanded);