aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2009-04-15 21:58:14 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2009-04-15 21:58:14 +0000
commit41ddecd9ed27239e478e65886fec3f0fd23f8cdb (patch)
treeb3dbcbbaf2911971b25937734160ab60905b6b2b /shell
parentc376db332cfcab6b25b381729bd658b703a2f36a (diff)
downloadbusybox-w32-41ddecd9ed27239e478e65886fec3f0fd23f8cdb.tar.gz
busybox-w32-41ddecd9ed27239e478e65886fec3f0fd23f8cdb.tar.bz2
busybox-w32-41ddecd9ed27239e478e65886fec3f0fd23f8cdb.zip
hush: fix heredoc_huge.tests broken in last commits
Diffstat (limited to 'shell')
-rw-r--r--shell/hush.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/shell/hush.c b/shell/hush.c
index b91e8c34d..1753be0d1 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -2461,11 +2461,15 @@ static void setup_heredoc(struct redir_struct *redir)
2461 * for the unsuspecting parent process. Child creates a grandchild 2461 * for the unsuspecting parent process. Child creates a grandchild
2462 * and exits before parent execs the process which consumes heredoc 2462 * and exits before parent execs the process which consumes heredoc
2463 * (that exec happens after we return from this function) */ 2463 * (that exec happens after we return from this function) */
2464#if !BB_MMU
2465 to_free = NULL;
2466#endif
2464 pid = vfork(); 2467 pid = vfork();
2465 if (pid < 0) 2468 if (pid < 0)
2466 bb_perror_msg_and_die("vfork"); 2469 bb_perror_msg_and_die("vfork");
2467 if (pid == 0) { 2470 if (pid == 0) {
2468 /* child */ 2471 /* child */
2472 disable_restore_tty_pgrp_on_exit();
2469 pid = BB_MMU ? fork() : vfork(); 2473 pid = BB_MMU ? fork() : vfork();
2470 if (pid < 0) 2474 if (pid < 0)
2471 bb_perror_msg_and_die(BB_MMU ? "fork" : "vfork"); 2475 bb_perror_msg_and_die(BB_MMU ? "fork" : "vfork");
@@ -2478,7 +2482,6 @@ static void setup_heredoc(struct redir_struct *redir)
2478 _exit(0); 2482 _exit(0);
2479#else 2483#else
2480 /* Delegate blocking writes to another process */ 2484 /* Delegate blocking writes to another process */
2481 disable_restore_tty_pgrp_on_exit();
2482 xmove_fd(pair.wr, STDOUT_FILENO); 2485 xmove_fd(pair.wr, STDOUT_FILENO);
2483 re_execute_shell(&to_free, heredoc, NULL, NULL); 2486 re_execute_shell(&to_free, heredoc, NULL, NULL);
2484#endif 2487#endif