diff options
author | Barton E. Schaefer <schaefer@zsh.org> | 2013-12-25 16:20:49 -0800 |
---|---|---|
committer | Barton E. Schaefer <schaefer@zsh.org> | 2013-12-25 16:20:49 -0800 |
commit | 15f4843c676cf73a854b35ec7fddb2cfe6be6fbe (patch) | |
tree | a4840ce2d9f5ba8b981feafe611472f690c87b0a /Src/jobs.c | |
parent | aede5c52bf557f89d1d09fa5430186af6e295241 (diff) | |
download | zsh-15f4843c676cf73a854b35ec7fddb2cfe6be6fbe.tar.gz zsh-15f4843c676cf73a854b35ec7fddb2cfe6be6fbe.tar.xz zsh-15f4843c676cf73a854b35ec7fddb2cfe6be6fbe.zip |
32178: fix another acquire_pgrp() infinite loop
Diffstat (limited to 'Src/jobs.c')
-rw-r--r-- | Src/jobs.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Src/jobs.c b/Src/jobs.c index a32117217..871946598 100644 --- a/Src/jobs.c +++ b/Src/jobs.c @@ -2619,6 +2619,7 @@ acquire_pgrp(void) sigset_t blockset, oldset; if ((mypgrp = GETPGRP()) > 0) { + long lastpgrp = mypgrp; sigemptyset(&blockset); sigaddset(&blockset, SIGTTIN); sigaddset(&blockset, SIGTTOU); @@ -2639,6 +2640,9 @@ acquire_pgrp(void) if (read(0, NULL, 0) != 0) {} /* Might generate SIGT* */ signal_block(blockset); mypgrp = GETPGRP(); + if (mypgrp == lastpgrp && !interact) + break; /* Unlikely that pgrp will ever change */ + lastpgrp = mypgrp; } if (mypgrp != mypid) { if (setpgrp(0, 0) == 0) { |