Use the current pgrp, not pid, when resetting the foreground process group.

Fixes bizarre suspension when executing `echo`.
This commit is contained in:
Matt Kraai 2001-05-02 15:37:09 +00:00
parent f162e7d09d
commit 1c8a59ab95
2 changed files with 2 additions and 2 deletions

2
hush.c
View File

@ -1186,7 +1186,7 @@ static int run_list_real(struct pipe *pi)
if (tcsetpgrp(0, pi->pgrp) && errno != ENOTTY)
perror_msg("tcsetpgrp");
rcode = pipe_wait(pi);
if (tcsetpgrp(0, getpid()) && errno != ENOTTY)
if (tcsetpgrp(0, getpgrp()) && errno != ENOTTY)
perror_msg("tcsetpgrp");
signal(SIGTTIN, SIG_DFL);
signal(SIGTTOU, SIG_DFL);

View File

@ -1186,7 +1186,7 @@ static int run_list_real(struct pipe *pi)
if (tcsetpgrp(0, pi->pgrp) && errno != ENOTTY)
perror_msg("tcsetpgrp");
rcode = pipe_wait(pi);
if (tcsetpgrp(0, getpid()) && errno != ENOTTY)
if (tcsetpgrp(0, getpgrp()) && errno != ENOTTY)
perror_msg("tcsetpgrp");
signal(SIGTTIN, SIG_DFL);
signal(SIGTTOU, SIG_DFL);