From 376dbc34bab272fd9929de4c0997cc7e3aa9727e Mon Sep 17 00:00:00 2001 From: ache Date: Wed, 7 Aug 2002 05:44:50 +0000 Subject: Back out workaround of fixing "suspend/fg" by price of breaking "stop $$/fg". This is real kernel bug (threads) and don't attempt to mask it by workarounds to increase chances to fix it in the kernel. --- usr.bin/su/su.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'usr.bin') diff --git a/usr.bin/su/su.c b/usr.bin/su/su.c index 5e98031..6348099 100644 --- a/usr.bin/su/su.c +++ b/usr.bin/su/su.c @@ -128,7 +128,7 @@ main(int argc, char *argv[]) uid_t ruid; gid_t gid; int asme, ch, asthem, fastlogin, prio, i, setwhat, retcode, - statusp, child_pid, ret_pid; + statusp, child_pid, child_pgrp, ret_pid; char *username, *cleanenv, *class, shellbuf[MAXPATHLEN]; const char *p, *user, *shell, *mytty, **nargv; @@ -329,7 +329,9 @@ 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); statusp = 1; continue; -- cgit v1.1