From 7fa30a1f74e98b0b893b7b10e4666cae2b29851d Mon Sep 17 00:00:00 2001 From: Nate Straz Date: Thu, 8 Dec 2005 22:55:32 +0000 Subject: Instead of ignoring SIGTTIN, ignore stdin if it is a tty. --- qarsh.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/qarsh.c b/qarsh.c index 21580f3..2d23989 100644 --- a/qarsh.c +++ b/qarsh.c @@ -214,7 +214,11 @@ run_remote_cmd(char *cmdline) FD_SET(qarsh_fd, &readfds); FD_SET(c_out, &readfds); FD_SET(c_err, &readfds); - FD_SET(fileno(stdin), &readfds); + /* Ignore stdin if it's a tty, we don't want to deal with + * tty i/o if we're a background process */ + if (!isatty(fileno(stdin))) { + FD_SET(fileno(stdin), &readfds); + } /* Setup signal handling stuff so we can propogate signals */ setup_signals(); @@ -416,12 +420,6 @@ main(int argc, char *argv[]) exit(1); } - memset(&sa, 0, sizeof sa); - sigemptyset(&sigmask); - sa.sa_mask = sigmask; - sa.sa_handler = SIG_IGN; - sigaction(SIGTTIN, &sa, NULL); - memset(&sa, 0, sizeof sa); sigemptyset(&sigmask); sa.sa_mask = sigmask; -- cgit