Fix su job control (recently introduced for PAM cleanup purposes) to not

kill login shell on either "suspend/fg" or "stop $$/fg" for tcsh. Since
this bug occurse on -stable too, it is not kernel threads bug.

Submitted by:	 David Xu <bsddiy@yahoo.com>
This commit is contained in:
Andrey A. Chernov 2002-08-12 10:49:01 +00:00
parent d8a0d0795b
commit 54c93e4f4d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=101722

View File

@ -329,10 +329,13 @@ main(int argc, char *argv[])
default:
while ((ret_pid = waitpid(child_pid, &statusp, WUNTRACED)) != -1) {
if (WIFSTOPPED(statusp)) {
child_pgrp = tcgetpgrp(1);
kill(getpid(), SIGSTOP);
tcsetpgrp(1, child_pgrp);
kill(child_pid, SIGCONT);
child_pgrp = getpgid(child_pid);
if (tcgetpgrp(1) == getpgrp())
{
tcsetpgrp(1, child_pgrp);
kill(child_pid, SIGCONT);
}
statusp = 1;
continue;
}