From: Jan Djärv Date: Fri, 20 Feb 2015 07:46:38 +0000 (+0100) Subject: Avoid endless loop when handling fatal signal. X-Git-Tag: emacs-25.0.90~2564^2~339 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=51d475a8d8a07e0edec92addd4bf96eb1be23b48;p=emacs.git Avoid endless loop when handling fatal signal. * src/emacs.c (terminate_due_to_signal): Move totally_unblock_input after setting fatal_error_in_progress, so gobble_input and *read_socket are not read if there are pending_signals. --- diff --git a/src/ChangeLog b/src/ChangeLog index 1126dde7450..dc33e417ef4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2015-02-20 Jan Djärv + + * emacs.c (terminate_due_to_signal): Move totally_unblock_input after + setting fatal_error_in_progress, so gobble_input and *read_socket are + not read if there are pending_signals. + 2015-02-20 Paul Eggert Simplify binary I/O configuration diff --git a/src/emacs.c b/src/emacs.c index f933eb1443d..590579907ff 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -345,13 +345,13 @@ _Noreturn void terminate_due_to_signal (int sig, int backtrace_limit) { signal (sig, SIG_DFL); - totally_unblock_input (); /* If fatal error occurs in code below, avoid infinite recursion. */ if (! fatal_error_in_progress) { fatal_error_in_progress = 1; + totally_unblock_input (); if (sig == SIGTERM || sig == SIGHUP || sig == SIGINT) Fkill_emacs (make_number (sig));