Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Cant fg a suspended su (4.1.0-dev-7)



"Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxx> writes:

> On Feb 21,  1:07pm, Peter Whaite wrote:
> }
> } I've noticed that I cannot resume a suspened su session lately (It
> } happened in 4.1.0-dev-6 as well). 
> } 
> } There is approximately a 1 second pause between the contined and the
> } suspended messages.  
> } 
> } Any idea why the su command re-suspends after the continue?
> 
> It appears to be this loop in bin_suspend():
> 
> 1669	    if (jobbing) {
> 1670		/* stay suspended */
> 1671		while (gettygrp() != mypgrp) {
> 1672		    sleep(1);
> 1673		    if (gettygrp() != mypgrp)
> 1674			kill(0, SIGTTIN);
> 1675		}
> 1676		/* restore signal handling */
> 1677		signal_ignore(SIGTTOU);
> 1678		signal_ignore(SIGTSTP);
> 1679		signal_ignore(SIGTTIN);
> 1680	    }
> 
> However, that code has been there forever [*] so the actual problem must
> lie in some change that's been made to tty process group handling.  I
> would tend to suspect that zsh-workers/17859 is the culprit.

Since I'm the author of the patch in zsh-workers/17859, I'm having a
look at it...

The above busy loop seems quite awful to me... But I'm looking into
the problem.

Phil.



Messages sorted by: Reverse Date, Date, Thread, Author