hush: die_sllep needs restoring only if job control is on

This commit is contained in:
Denis Vlasenko 2008-02-11 08:44:36 +00:00
parent 08126f665d
commit 83177991c8

View File

@ -759,6 +759,7 @@ static void handler_ctrl_z(int sig)
return;
ctrl_z_flag = 1;
if (!pid) { /* child */
if (ENABLE_HUSH_JOB)
die_sleep = 0; /* let nofork's xfuncs die */
setpgrp();
debug_printf_jobs("set pgrp for child %d ok\n", getpid());
@ -1900,6 +1901,7 @@ static int run_pipe(struct pipe *pi)
child->pid = BB_MMU ? fork() : vfork();
if (!child->pid) { /* child */
if (ENABLE_HUSH_JOB)
die_sleep = 0; /* let nofork's xfuncs die */
#if ENABLE_HUSH_JOB
/* Every child adds itself to new process group
@ -3239,6 +3241,7 @@ 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 */
if (ENABLE_HUSH_JOB)
die_sleep = 0; /* let nofork's xfuncs die */
close(channel[0]);
xmove_fd(channel[1], 1);