From 8792262eee4455c710d6cb7401cee1cf414e9746 Mon Sep 17 00:00:00 2001 From: davidxu Date: Mon, 3 Nov 2003 23:54:55 +0000 Subject: It seems when su executes in a shell scripts, there is a timing race, sometimes, su will receive a SIGTTOU when parent su tries to set child su's process group as foreground group, and su will be stopped unexpectly, ignoring SIGTTOU fixes the problem. Noticed by: fjoe --- usr.bin/su/su.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'usr.bin') diff --git a/usr.bin/su/su.c b/usr.bin/su/su.c index dae818f..8eac299 100644 --- a/usr.bin/su/su.c +++ b/usr.bin/su/su.c @@ -359,6 +359,8 @@ main(int argc, char *argv[]) child_pid = fork(); switch (child_pid) { default: + sa.sa_handler = SIG_IGN; + sigaction(SIGTTOU, &sa, NULL); close(fds[0]); setpgid(child_pid, child_pid); tcsetpgrp(1, child_pid); -- cgit v1.1