summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorDenys Vlasenko2011-02-02 18:38:57 +0100
committerDenys Vlasenko2011-02-02 18:38:57 +0100
commitb72baeb00328576df415f9a4b4f3d5f202e3be11 (patch)
treec6863cb112e6e33908e17f298d541c1b0c3aa418 /shell
parentc71b469f5daceb717e31cc9ce46b0e058e2c57b6 (diff)
downloadbusybox-b72baeb00328576df415f9a4b4f3d5f202e3be11.zip
busybox-b72baeb00328576df415f9a4b4f3d5f202e3be11.tar.gz
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')
-rw-r--r--shell/Config.src9
-rw-r--r--shell/hush.c11
2 files changed, 10 insertions, 10 deletions
diff --git a/shell/Config.src b/shell/Config.src
index c9c2439..e96c216 100644
--- a/shell/Config.src
+++ b/shell/Config.src
@@ -123,9 +123,9 @@ config FEATURE_SH_NOFORK
default n
depends on (HUSH || ASH) && FEATURE_PREFER_APPLETS
help
- This option causes busybox shells [currently only ash]
- to not execute typical fork/exec/wait sequence, but call <applet>_main
- directly, if possible. (Sometimes it is not possible: for example,
+ This option causes busybox shells to not execute typical
+ fork/exec/wait sequence, but call <applet>_main directly,
+ if possible. (Sometimes it is not possible: for example,
this is not possible in pipes).
This will be done only for some applets (those which are marked
@@ -133,6 +133,7 @@ config FEATURE_SH_NOFORK
This may significantly speed up some shell scripts.
- This feature is relatively new. Use with care.
+ This feature is relatively new. Use with care. Report bugs
+ to project mailing list.
endmenu
diff --git a/shell/hush.c b/shell/hush.c
index 1709fd9..10788b8 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -6615,7 +6615,7 @@ static int checkjobs_and_fg_shell(struct pipe *fg_pipe)
* cmd ; ... { list } ; ...
* cmd && ... { list } && ...
* cmd || ... { list } || ...
- * If it is, then we can run cmd as a builtin, NOFORK [do we do this?],
+ * If it is, then we can run cmd as a builtin, NOFORK,
* or (if SH_STANDALONE) an applet, and we can run the { list }
* with run_list. If it isn't one of these, we fork and exec cmd.
*
@@ -6797,13 +6797,12 @@ static NOINLINE int run_pipe(struct pipe *pi)
}
/* Expand the rest into (possibly) many strings each */
- if (0) {}
#if ENABLE_HUSH_BASH_COMPAT
- else if (command->cmd_type == CMD_SINGLEWORD_NOGLOB) {
+ if (command->cmd_type == CMD_SINGLEWORD_NOGLOB) {
argv_expanded = expand_strvec_to_strvec_singleword_noglob(argv + command->assignment_cnt);
- }
+ } else
#endif
- else {
+ {
argv_expanded = expand_strvec_to_strvec(argv + command->assignment_cnt);
}
@@ -6865,7 +6864,7 @@ static NOINLINE int run_pipe(struct pipe *pi)
return rcode;
}
- if (ENABLE_FEATURE_SH_STANDALONE) {
+ if (ENABLE_FEATURE_SH_NOFORK) {
int n = find_applet_by_name(argv_expanded[0]);
if (n >= 0 && APPLET_IS_NOFORK(n)) {
rcode = redirect_and_varexp_helper(&new_env, &old_vars, command, squirrel, argv_expanded);