summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>2006-01-02 09:46:38 +0000
committerbrian <brian@FreeBSD.org>2006-01-02 09:46:38 +0000
commit6e6de63b656a2e0baa692abfdaa3ed4e487b8cee (patch)
tree31e64b0df5a271c9aa0a41d8ed0017dc0ac519bb /usr.bin
parent84096d5a146bdbbebe4a4c9f1867a69c9508d0c4 (diff)
downloadFreeBSD-src-6e6de63b656a2e0baa692abfdaa3ed4e487b8cee.zip
FreeBSD-src-6e6de63b656a2e0baa692abfdaa3ed4e487b8cee.tar.gz
Handle the case (that I just broke) where the following hangs:
$ su # kill -STOP $$ Pointed out by: David Xu <davidxu@freebsd.org>
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/su/su.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/su/su.c b/usr.bin/su/su.c
index 621c351..ba592b0 100644
--- a/usr.bin/su/su.c
+++ b/usr.bin/su/su.c
@@ -156,7 +156,7 @@ main(int argc, char *argv[])
char * const *b;
} np;
uid_t ruid;
- pid_t child_pid, child_pgrp, pid;
+ pid_t child_pid, pid;
int asme, ch, asthem, fastlogin, prio, i, retcode,
statusp, setmaclabel;
u_int setwhat;
@@ -396,6 +396,8 @@ main(int argc, char *argv[])
sigaction(SIGPIPE, &sa_pipe, NULL);
while ((pid = waitpid(child_pid, &statusp, WUNTRACED)) != -1) {
if (WIFSTOPPED(statusp)) {
+ kill(getpid(), SIGSTOP);
+ kill(child_pid, SIGCONT);
statusp = 1;
continue;
}
OpenPOWER on IntegriCloud