mirror of
https://github.com/sheumann/hush.git
synced 2024-08-25 21:28:57 +00:00
Use the current pgrp, not pid, when resetting the foreground process group.
Fixes bizarre suspension when executing `echo`.
This commit is contained in:
parent
f162e7d09d
commit
1c8a59ab95
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)
|
||||
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);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user