summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorDenis Vlasenko2008-02-11 08:44:36 +0000
committerDenis Vlasenko2008-02-11 08:44:36 +0000
commit83177991c86dd49ac447225f33b84e1883ca49ee (patch)
tree975bfb949a4875af6640cf23e58e2c87eeed5d54 /shell
parent08126f665d6b8d761da61acd50acaafa49cff79f (diff)
downloadbusybox-83177991c86dd49ac447225f33b84e1883ca49ee.zip
busybox-83177991c86dd49ac447225f33b84e1883ca49ee.tar.gz
hush: die_sllep needs restoring only if job control is on
Diffstat (limited to 'shell')
-rw-r--r--shell/hush.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/shell/hush.c b/shell/hush.c
index 29807f8..3f46103 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -759,7 +759,8 @@ static void handler_ctrl_z(int sig)
return;
ctrl_z_flag = 1;
if (!pid) { /* child */
- die_sleep = 0; /* let nofork's xfuncs die */
+ if (ENABLE_HUSH_JOB)
+ die_sleep = 0; /* let nofork's xfuncs die */
setpgrp();
debug_printf_jobs("set pgrp for child %d ok\n", getpid());
set_every_sighandler(SIG_DFL);
@@ -1900,7 +1901,8 @@ static int run_pipe(struct pipe *pi)
child->pid = BB_MMU ? fork() : vfork();
if (!child->pid) { /* child */
- die_sleep = 0; /* let nofork's xfuncs die */
+ if (ENABLE_HUSH_JOB)
+ die_sleep = 0; /* let nofork's xfuncs die */
#if ENABLE_HUSH_JOB
/* Every child adds itself to new process group
* with pgid == pid_of_first_child_in_pipe */
@@ -3239,7 +3241,8 @@ static FILE *generate_stream_from_list(struct pipe *head)
if (pid < 0)
bb_perror_msg_and_die(BB_MMU ? "fork" : "vfork");
if (pid == 0) { /* child */
- die_sleep = 0; /* let nofork's xfuncs die */
+ if (ENABLE_HUSH_JOB)
+ die_sleep = 0; /* let nofork's xfuncs die */
close(channel[0]);
xmove_fd(channel[1], 1);
/* Prevent it from trying to handle ctrl-z etc */