From 6e6de63b656a2e0baa692abfdaa3ed4e487b8cee Mon Sep 17 00:00:00 2001 From: brian Date: Mon, 2 Jan 2006 09:46:38 +0000 Subject: Handle the case (that I just broke) where the following hangs: $ su # kill -STOP $$ Pointed out by: David Xu --- usr.bin/su/su.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'usr.bin/su') 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; } -- cgit v1.1