Commit 62a1d661 authored by Paul Eggert's avatar Paul Eggert

Do not use SA_NODEFER.

Problem reported by Dani Moncayo in
<http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
* alloc.c (die):
* sysdep.c (emacs_abort): Do not reset signal handler.
* emacs.c (terminate_due_to_signal): Reset signal handler here.
* sysdep.c (init_signals): Do not use SA_NODEFER.  It wasn't
wanted even on POSIXish hosts, and it doesn't work on Windows.
parent 70efc5c9
2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
Do not use SA_NODEFER.
Problem reported by Dani Moncayo in
<http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
* alloc.c (die):
* sysdep.c (emacs_abort): Do not reset signal handler.
* emacs.c (terminate_due_to_signal): Reset signal handler here.
* sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
wanted even on POSIXish hosts, and it doesn't work on Windows.
2012-09-23 Jan Djärv <jan.h.d@swipnet.se> 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
* xterm.c (x_term_init): Call fixup_locale before and after calling * xterm.c (x_term_init): Call fixup_locale before and after calling
......
...@@ -6393,7 +6393,6 @@ bool suppress_checking; ...@@ -6393,7 +6393,6 @@ bool suppress_checking;
void void
die (const char *msg, const char *file, int line) die (const char *msg, const char *file, int line)
{ {
signal (SIGABRT, SIG_DFL);
fprintf (stderr, "\r\n%s:%d: Emacs fatal error: %s\r\n", fprintf (stderr, "\r\n%s:%d: Emacs fatal error: %s\r\n",
file, line, msg); file, line, msg);
terminate_due_to_signal (SIGABRT, INT_MAX); terminate_due_to_signal (SIGABRT, INT_MAX);
......
...@@ -285,6 +285,7 @@ static void *ns_pool; ...@@ -285,6 +285,7 @@ static void *ns_pool;
_Noreturn void _Noreturn void
terminate_due_to_signal (int sig, int backtrace_limit) terminate_due_to_signal (int sig, int backtrace_limit)
{ {
signal (sig, SIG_DFL);
totally_unblock_input (); totally_unblock_input ();
/* If fatal error occurs in code below, avoid infinite recursion. */ /* If fatal error occurs in code below, avoid infinite recursion. */
......
...@@ -1763,7 +1763,7 @@ init_signals (bool dumping) ...@@ -1763,7 +1763,7 @@ init_signals (bool dumping)
sigfillset (&process_fatal_action.sa_mask); sigfillset (&process_fatal_action.sa_mask);
process_fatal_action.sa_handler = deliver_fatal_signal; process_fatal_action.sa_handler = deliver_fatal_signal;
process_fatal_action.sa_flags = emacs_sigaction_flags () | SA_NODEFER; process_fatal_action.sa_flags = emacs_sigaction_flags ();
sigfillset (&thread_fatal_action.sa_mask); sigfillset (&thread_fatal_action.sa_mask);
thread_fatal_action.sa_handler = deliver_fatal_thread_signal; thread_fatal_action.sa_handler = deliver_fatal_thread_signal;
...@@ -2044,7 +2044,6 @@ emacs_backtrace (int backtrace_limit) ...@@ -2044,7 +2044,6 @@ emacs_backtrace (int backtrace_limit)
void void
emacs_abort (void) emacs_abort (void)
{ {
signal (SIGABRT, SIG_DFL);
terminate_due_to_signal (SIGABRT, 10); terminate_due_to_signal (SIGABRT, 10);
} }
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment