aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
Diffstat (limited to 'shell')
-rw-r--r--shell/hush.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/shell/hush.c b/shell/hush.c
index 29ff3c442..831443e2e 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -3208,15 +3208,11 @@ static void setup_heredoc(struct redir_struct *redir)
3208#if !BB_MMU 3208#if !BB_MMU
3209 to_free = NULL; 3209 to_free = NULL;
3210#endif 3210#endif
3211 pid = vfork(); 3211 pid = xvfork();
3212 if (pid < 0)
3213 bb_perror_msg_and_die("vfork");
3214 if (pid == 0) { 3212 if (pid == 0) {
3215 /* child */ 3213 /* child */
3216 disable_restore_tty_pgrp_on_exit(); 3214 disable_restore_tty_pgrp_on_exit();
3217 pid = BB_MMU ? fork() : vfork(); 3215 pid = BB_MMU ? xfork() : xvfork();
3218 if (pid < 0)
3219 bb_perror_msg_and_die(BB_MMU ? "fork" : "vfork");
3220 if (pid != 0) 3216 if (pid != 0)
3221 _exit(0); 3217 _exit(0);
3222 /* grandchild */ 3218 /* grandchild */
@@ -4450,7 +4446,7 @@ static NOINLINE int run_pipe(struct pipe *pi)
4450 argv_expanded = NULL; 4446 argv_expanded = NULL;
4451 if (command->pid < 0) { /* [v]fork failed */ 4447 if (command->pid < 0) { /* [v]fork failed */
4452 /* Clearly indicate, was it fork or vfork */ 4448 /* Clearly indicate, was it fork or vfork */
4453 bb_perror_msg(BB_MMU ? "fork" : "vfork"); 4449 bb_perror_msg(BB_MMU ? "vfork"+1 : "vfork");
4454 } else { 4450 } else {
4455 pi->alive_cmds++; 4451 pi->alive_cmds++;
4456#if ENABLE_HUSH_JOB 4452#if ENABLE_HUSH_JOB
@@ -5586,10 +5582,7 @@ static FILE *generate_stream_from_string(const char *s, pid_t *pid_p)
5586# endif 5582# endif
5587 5583
5588 xpipe(channel); 5584 xpipe(channel);
5589 pid = BB_MMU ? fork() : vfork(); 5585 pid = BB_MMU ? xfork() : xvfork();
5590 if (pid < 0)
5591 bb_perror_msg_and_die(BB_MMU ? "fork" : "vfork");
5592
5593 if (pid == 0) { /* child */ 5586 if (pid == 0) { /* child */
5594 disable_restore_tty_pgrp_on_exit(); 5587 disable_restore_tty_pgrp_on_exit();
5595 /* Process substitution is not considered to be usual 5588 /* Process substitution is not considered to be usual