summaryrefslogtreecommitdiff
path: root/src/emacs.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/emacs.c')
-rw-r--r--src/emacs.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/emacs.c b/src/emacs.c
index 172e4607694..d1b010ec7fe 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -386,7 +386,14 @@ terminate_due_to_signal (int sig, int backtrace_limit)
totally_unblock_input ();
if (sig == SIGTERM || sig == SIGHUP || sig == SIGINT)
- Fkill_emacs (make_fixnum (sig));
+ {
+ /* Avoid abort in shut_down_emacs if we were interrupted
+ by SIGINT in noninteractive usage, as in that case we
+ don't care about the message stack. */
+ if (sig == SIGINT && noninteractive)
+ clear_message_stack ();
+ Fkill_emacs (make_fixnum (sig));
+ }
shut_down_emacs (sig, Qnil);
emacs_backtrace (backtrace_limit);