From d039c62baae9453e923687a28a17c4dafceb098e Mon Sep 17 00:00:00 2001 From: Brian Somers Date: Mon, 2 Jan 2006 09:46:38 +0000 Subject: [PATCH] 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(-) diff --git a/usr.bin/su/su.c b/usr.bin/su/su.c index 621c351ce5a9..ba592b06279e 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; }