Use the current pgrp, not pid, when resetting the foreground process group.
Fixes bizarre suspension when executing `echo`.
This commit is contained in:
1 parent
f162e7d09d
commit
1c8a59ab95
2 files changed
+2
-2
No files matched your search
@@ -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);
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user