diff options
author | Daniel Colascione <dancol@dancol.org> | 2016-01-04 14:12:01 -0800 |
---|---|---|
committer | Daniel Colascione <dancol@dancol.org> | 2016-01-04 14:12:01 -0800 |
commit | 989bcc77ab576d7a83cb0194a9fc73ce51939042 (patch) | |
tree | 2dbcef6cc44791aa7679978f7b46420c7fe6b454 /src/emacs.c | |
parent | e94b1799d4f4c57266bdbc4801b26fe0121b7c7a (diff) | |
download | emacs-989bcc77ab576d7a83cb0194a9fc73ce51939042.tar.gz emacs-989bcc77ab576d7a83cb0194a9fc73ce51939042.tar.bz2 emacs-989bcc77ab576d7a83cb0194a9fc73ce51939042.zip |
Let users disable unsafe signal handling code
* src/keyboard.c (syms_of_keyboard): New user variables
`attempt-stack-overflow-recovery' and
`attempt-orderly-shutdown-on-fatal-signal'.
* src/sysdep.c (stack_overflow): Check
`attempt-stack-overflow-recovery'.
* src/emacs.c (terminate_due_to_signal): Check
`attempt-orderly-shutdown-on-fatal-signal'.
Diffstat (limited to 'src/emacs.c')
-rw-r--r-- | src/emacs.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/emacs.c b/src/emacs.c index 926aa989e6a..d13413d880b 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -370,17 +370,20 @@ terminate_due_to_signal (int sig, int backtrace_limit) { signal (sig, SIG_DFL); - /* If fatal error occurs in code below, avoid infinite recursion. */ - if (! fatal_error_in_progress) + if (attempt_orderly_shutdown_on_fatal_signal) { - fatal_error_in_progress = 1; + /* 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)); + totally_unblock_input (); + if (sig == SIGTERM || sig == SIGHUP || sig == SIGINT) + Fkill_emacs (make_number (sig)); - shut_down_emacs (sig, Qnil); - emacs_backtrace (backtrace_limit); + shut_down_emacs (sig, Qnil); + emacs_backtrace (backtrace_limit); + } } /* Signal the same code; this time it will really be fatal. |