summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--shell/ash.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 97a28b1..01a02d3 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -5995,13 +5995,10 @@ static void setjobctl(int enable)
mflag = 0;
return;
}
- if (initialpgrp == -1)
- initialpgrp = getpgrp();
- else if (initialpgrp != getpgrp()) {
- killpg(initialpgrp, SIGTTIN);
- continue;
- }
- } while (0);
+ if (initialpgrp == getpgrp())
+ break;
+ killpg(0, SIGTTIN);
+ } while (1);
setsignal(SIGTSTP);
setsignal(SIGTTOU);
setsignal(SIGTTIN);