From e6082c44cba0749864df4db1e0ce43fb9ce2a68a Mon Sep 17 00:00:00 2001 From: Dan Harkless Date: Thu, 13 May 1999 01:25:52 +0000 Subject: [PATCH] Fixed a signal-handling bug that could cause whatnow to sometimes exit without prompting the user. Based on a patch by Richard Geiger . --- sbr/pidwait.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sbr/pidwait.c b/sbr/pidwait.c index 4bd02e3..0bbe588 100644 --- a/sbr/pidwait.c +++ b/sbr/pidwait.c @@ -18,6 +18,7 @@ pidwait (pid_t id, int sigsok) { pid_t pid; sigset_t set, oset; + SIGNAL_HANDLER istat, qstat; #ifdef WAITINT int status; @@ -26,11 +27,9 @@ pidwait (pid_t id, int sigsok) #endif if (sigsok == -1) { - /* block a couple of signals */ - sigemptyset (&set); - sigaddset (&set, SIGINT); - sigaddset (&set, SIGQUIT); - SIGPROCMASK (SIG_BLOCK, &set, &oset); + /* ignore a couple of signals */ + istat = SIGNAL (SIGINT, SIG_IGN); + qstat = SIGNAL (SIGQUIT, SIG_IGN); } #ifdef HAVE_WAITPID @@ -41,8 +40,9 @@ pidwait (pid_t id, int sigsok) #endif if (sigsok == -1) { - /* reset the signal mask */ - SIGPROCMASK (SIG_SETMASK, &oset, &set); + /* reset the signal handlers */ + SIGNAL (SIGINT, istat); + SIGNAL (SIGQUIT, qstat); } #ifdef WAITINT -- 1.7.10.4