mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-23 16:40:24 +02:00
32178: fix another acquire_pgrp() infinite loop
This commit is contained in:
parent
aede5c52bf
commit
15f4843c67
2 changed files with 9 additions and 1 deletions
|
@ -1,4 +1,8 @@
|
|||
2013-12-21 Barton E. Schaefer <schaefer@brasslantern.com>
|
||||
2013-12-25 Barton E. Schaefer <schaefer@zsh.org>
|
||||
|
||||
* 32178: Src/jobs.c: fix another acquire_pgrp() infinite loop
|
||||
|
||||
2013-12-21 Barton E. Schaefer <schaefer@zsh.org>
|
||||
|
||||
* PWS + Bart: 32176: plug additional descriptor leaks causing
|
||||
deadlock via different code paths; expand regression test
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue