diff options
| author | Jan Djärv | 2015-02-20 08:46:38 +0100 |
|---|---|---|
| committer | Jan Djärv | 2015-02-20 08:46:38 +0100 |
| commit | 51d475a8d8a07e0edec92addd4bf96eb1be23b48 (patch) | |
| tree | 9af2c6b00a6119845604117e189c9bd15cba6cb8 /src | |
| parent | 98cb7d9e4d7ff3e9cb8aad229e30dbd0a7963a8f (diff) | |
| download | emacs-51d475a8d8a07e0edec92addd4bf96eb1be23b48.tar.gz emacs-51d475a8d8a07e0edec92addd4bf96eb1be23b48.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/emacs.c | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 1126dde7450..dc33e417ef4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2015-02-20 Jan Djärv <jan.h.d@swipnet.se> | ||
| 2 | |||
| 3 | * emacs.c (terminate_due_to_signal): Move totally_unblock_input after | ||
| 4 | setting fatal_error_in_progress, so gobble_input and *read_socket are | ||
| 5 | not read if there are pending_signals. | ||
| 6 | |||
| 1 | 2015-02-20 Paul Eggert <eggert@cs.ucla.edu> | 7 | 2015-02-20 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 8 | ||
| 3 | Simplify binary I/O configuration | 9 | 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 | |||
| 345 | terminate_due_to_signal (int sig, int backtrace_limit) | 345 | terminate_due_to_signal (int sig, int backtrace_limit) |
| 346 | { | 346 | { |
| 347 | signal (sig, SIG_DFL); | 347 | signal (sig, SIG_DFL); |
| 348 | totally_unblock_input (); | ||
| 349 | 348 | ||
| 350 | /* If fatal error occurs in code below, avoid infinite recursion. */ | 349 | /* If fatal error occurs in code below, avoid infinite recursion. */ |
| 351 | if (! fatal_error_in_progress) | 350 | if (! fatal_error_in_progress) |
| 352 | { | 351 | { |
| 353 | fatal_error_in_progress = 1; | 352 | fatal_error_in_progress = 1; |
| 354 | 353 | ||
| 354 | totally_unblock_input (); | ||
| 355 | if (sig == SIGTERM || sig == SIGHUP || sig == SIGINT) | 355 | if (sig == SIGTERM || sig == SIGHUP || sig == SIGINT) |
| 356 | Fkill_emacs (make_number (sig)); | 356 | Fkill_emacs (make_number (sig)); |
| 357 | 357 | ||