aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hush.c2
-rw-r--r--shell/hush.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/hush.c b/hush.c
index 9134251f5..4641e59c8 100644
--- a/hush.c
+++ b/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);
diff --git a/shell/hush.c b/shell/hush.c
index 9134251f5..4641e59c8 100644
--- a/shell/hush.c
+++ b/shell/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);