Handle the case (that I just broke) where the following hangs:

$ su
    # kill -STOP $$

Pointed out by:	David Xu <davidxu@freebsd.org>
This commit is contained in:
Brian Somers 2006-01-02 09:46:38 +00:00
parent f595d62759
commit d039c62baa
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=153966

View File

@ -156,7 +156,7 @@ main(int argc, char *argv[])
char * const *b; char * const *b;
} np; } np;
uid_t ruid; uid_t ruid;
pid_t child_pid, child_pgrp, pid; pid_t child_pid, pid;
int asme, ch, asthem, fastlogin, prio, i, retcode, int asme, ch, asthem, fastlogin, prio, i, retcode,
statusp, setmaclabel; statusp, setmaclabel;
u_int setwhat; u_int setwhat;
@ -396,6 +396,8 @@ main(int argc, char *argv[])
sigaction(SIGPIPE, &sa_pipe, NULL); sigaction(SIGPIPE, &sa_pipe, NULL);
while ((pid = waitpid(child_pid, &statusp, WUNTRACED)) != -1) { while ((pid = waitpid(child_pid, &statusp, WUNTRACED)) != -1) {
if (WIFSTOPPED(statusp)) { if (WIFSTOPPED(statusp)) {
kill(getpid(), SIGSTOP);
kill(child_pid, SIGCONT);
statusp = 1; statusp = 1;
continue; continue;
} }