diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-02-11 08:44:36 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-02-11 08:44:36 +0000 |
commit | 83177991c86dd49ac447225f33b84e1883ca49ee (patch) | |
tree | 975bfb949a4875af6640cf23e58e2c87eeed5d54 | |
parent | 08126f665d6b8d761da61acd50acaafa49cff79f (diff) | |
download | busybox-w32-83177991c86dd49ac447225f33b84e1883ca49ee.tar.gz busybox-w32-83177991c86dd49ac447225f33b84e1883ca49ee.tar.bz2 busybox-w32-83177991c86dd49ac447225f33b84e1883ca49ee.zip |
hush: die_sllep needs restoring only if job control is on
-rw-r--r-- | shell/hush.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/shell/hush.c b/shell/hush.c index 29807f889..3f4610391 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -759,7 +759,8 @@ static void handler_ctrl_z(int sig) | |||
759 | return; | 759 | return; |
760 | ctrl_z_flag = 1; | 760 | ctrl_z_flag = 1; |
761 | if (!pid) { /* child */ | 761 | if (!pid) { /* child */ |
762 | die_sleep = 0; /* let nofork's xfuncs die */ | 762 | if (ENABLE_HUSH_JOB) |
763 | die_sleep = 0; /* let nofork's xfuncs die */ | ||
763 | setpgrp(); | 764 | setpgrp(); |
764 | debug_printf_jobs("set pgrp for child %d ok\n", getpid()); | 765 | debug_printf_jobs("set pgrp for child %d ok\n", getpid()); |
765 | set_every_sighandler(SIG_DFL); | 766 | set_every_sighandler(SIG_DFL); |
@@ -1900,7 +1901,8 @@ static int run_pipe(struct pipe *pi) | |||
1900 | 1901 | ||
1901 | child->pid = BB_MMU ? fork() : vfork(); | 1902 | child->pid = BB_MMU ? fork() : vfork(); |
1902 | if (!child->pid) { /* child */ | 1903 | if (!child->pid) { /* child */ |
1903 | die_sleep = 0; /* let nofork's xfuncs die */ | 1904 | if (ENABLE_HUSH_JOB) |
1905 | die_sleep = 0; /* let nofork's xfuncs die */ | ||
1904 | #if ENABLE_HUSH_JOB | 1906 | #if ENABLE_HUSH_JOB |
1905 | /* Every child adds itself to new process group | 1907 | /* Every child adds itself to new process group |
1906 | * with pgid == pid_of_first_child_in_pipe */ | 1908 | * with pgid == pid_of_first_child_in_pipe */ |
@@ -3239,7 +3241,8 @@ static FILE *generate_stream_from_list(struct pipe *head) | |||
3239 | if (pid < 0) | 3241 | if (pid < 0) |
3240 | bb_perror_msg_and_die(BB_MMU ? "fork" : "vfork"); | 3242 | bb_perror_msg_and_die(BB_MMU ? "fork" : "vfork"); |
3241 | if (pid == 0) { /* child */ | 3243 | if (pid == 0) { /* child */ |
3242 | die_sleep = 0; /* let nofork's xfuncs die */ | 3244 | if (ENABLE_HUSH_JOB) |
3245 | die_sleep = 0; /* let nofork's xfuncs die */ | ||
3243 | close(channel[0]); | 3246 | close(channel[0]); |
3244 | xmove_fd(channel[1], 1); | 3247 | xmove_fd(channel[1], 1); |
3245 | /* Prevent it from trying to handle ctrl-z etc */ | 3248 | /* Prevent it from trying to handle ctrl-z etc */ |