Avoid kill-emacs-hook errors hanging batch mode

* src/emacs.c (Fkill_emacs): Prevent errors from kill-emacs-hook
hanging Emacs in batch mode.  (Bug#29955)

(cherry picked from commit 109da684c5)
This commit is contained in:
Glenn Morris 2018-01-23 20:55:09 -05:00
parent e3b3683660
commit b8bbbe54dd

View file

@ -2017,7 +2017,10 @@ all of which are called before Emacs is actually killed. */
/* Fsignal calls emacs_abort () if it sees that waiting_for_input is
set. */
waiting_for_input = 0;
run_hook (Qkill_emacs_hook);
if (noninteractive)
safe_run_hooks (Qkill_emacs_hook);
else
run_hook (Qkill_emacs_hook);
#ifdef HAVE_X_WINDOWS
/* Transfer any clipboards we own to the clipboard manager. */