summaryrefslogtreecommitdiff
path: root/src/atimer.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2014-05-29 21:12:08 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2014-05-29 21:12:08 -0700
commit8cf1e6e67926683e38809adced986d255124afd5 (patch)
tree778900c1d56daa5ffebf44e14c51d0f6a9410a40 /src/atimer.c
parentacc16b66ffe8e3b0f3568c5ae2e3bf0dff2bc2fa (diff)
downloademacs-8cf1e6e67926683e38809adced986d255124afd5.tar.gz
Don't let SIGINT handling block SIGCHLD indefinitely.
* atimer.c (block_atimers): * callproc.c (block_child_signal): Block SIGINT too; otherwise, its handler might now unblock signals that it shouldn't. * keyboard.c (read_char): Clear signal mask, since we may be in a SIGINT handler, and many signals may be masked. * keyboard.c (handle_interrupt): * sysdep.c (handle_arith_signal): Clear signal mask instead of just unblocking the signal that was received, since several signals may be blocked at this point. Fixes: debbugs:17561
Diffstat (limited to 'src/atimer.c')
-rw-r--r--src/atimer.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/atimer.c b/src/atimer.c
index a5a2b0714e3..e457a7fcf1c 100644
--- a/src/atimer.c
+++ b/src/atimer.c
@@ -55,6 +55,7 @@ block_atimers (sigset_t *oldset)
sigset_t blocked;
sigemptyset (&blocked);
sigaddset (&blocked, SIGALRM);
+ sigaddset (&blocked, SIGINT);
pthread_sigmask (SIG_BLOCK, &blocked, oldset);
}
static void
@@ -404,7 +405,6 @@ turn_on_atimers (bool on)
void
init_atimer (void)
{
- struct sigaction action;
#ifdef HAVE_ITIMERSPEC
struct sigevent sigev;
sigev.sigev_notify = SIGEV_SIGNAL;
@@ -413,7 +413,9 @@ init_atimer (void)
alarm_timer_ok = timer_create (CLOCK_REALTIME, &sigev, &alarm_timer) == 0;
#endif
free_atimers = stopped_atimers = atimers = NULL;
- /* pending_signals is initialized in init_keyboard.*/
+
+ /* pending_signals is initialized in init_keyboard. */
+ struct sigaction action;
emacs_sigaction_init (&action, handle_alarm_signal);
sigaction (SIGALRM, &action, 0);
}