Use the current pgrp, not pid, when resetting the foreground process group.
Fixes bizarre suspension when executing `echo`.
This commit is contained in:
2
hush.c
2
hush.c
@@ -1186,7 +1186,7 @@ static int run_list_real(struct pipe *pi)
|
|||||||
if (tcsetpgrp(0, pi->pgrp) && errno != ENOTTY)
|
if (tcsetpgrp(0, pi->pgrp) && errno != ENOTTY)
|
||||||
perror_msg("tcsetpgrp");
|
perror_msg("tcsetpgrp");
|
||||||
rcode = pipe_wait(pi);
|
rcode = pipe_wait(pi);
|
||||||
if (tcsetpgrp(0, getpid()) && errno != ENOTTY)
|
if (tcsetpgrp(0, getpgrp()) && errno != ENOTTY)
|
||||||
perror_msg("tcsetpgrp");
|
perror_msg("tcsetpgrp");
|
||||||
signal(SIGTTIN, SIG_DFL);
|
signal(SIGTTIN, SIG_DFL);
|
||||||
signal(SIGTTOU, SIG_DFL);
|
signal(SIGTTOU, SIG_DFL);
|
||||||
|
@@ -1186,7 +1186,7 @@ static int run_list_real(struct pipe *pi)
|
|||||||
if (tcsetpgrp(0, pi->pgrp) && errno != ENOTTY)
|
if (tcsetpgrp(0, pi->pgrp) && errno != ENOTTY)
|
||||||
perror_msg("tcsetpgrp");
|
perror_msg("tcsetpgrp");
|
||||||
rcode = pipe_wait(pi);
|
rcode = pipe_wait(pi);
|
||||||
if (tcsetpgrp(0, getpid()) && errno != ENOTTY)
|
if (tcsetpgrp(0, getpgrp()) && errno != ENOTTY)
|
||||||
perror_msg("tcsetpgrp");
|
perror_msg("tcsetpgrp");
|
||||||
signal(SIGTTIN, SIG_DFL);
|
signal(SIGTTIN, SIG_DFL);
|
||||||
signal(SIGTTOU, SIG_DFL);
|
signal(SIGTTOU, SIG_DFL);
|
||||||
|
Reference in New Issue
Block a user