aboutsummaryrefslogtreecommitdiffstats
path: root/src/comp.c
diff options
context:
space:
mode:
authorAndrea Corallo2020-01-02 22:14:25 +0100
committerAndrea Corallo2020-01-02 23:01:33 +0100
commit3039c55642fbb2feb577e057ee167c2cedc12feb (patch)
tree7742e3c485f9982d4daa93d49eb6e6994675e064 /src/comp.c
parent5252b59b2b3a7959160378cbd0ecb09d9a1da24b (diff)
downloademacs-3039c55642fbb2feb577e057ee167c2cedc12feb.tar.gz
emacs-3039c55642fbb2feb577e057ee167c2cedc12feb.zip
Do not block sw interrupts in batch mode (don't ignore C-c)
Diffstat (limited to 'src/comp.c')
-rw-r--r--src/comp.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/comp.c b/src/comp.c
index c25b3245ca3..bb8b952cf52 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -3110,16 +3110,19 @@ DEFUN ("comp--compile-ctxt-to-file", Fcomp__compile_ctxt_to_file,
3110 gcc_jit_context_set_int_option (comp.ctxt, 3110 gcc_jit_context_set_int_option (comp.ctxt,
3111 GCC_JIT_INT_OPTION_OPTIMIZATION_LEVEL, 3111 GCC_JIT_INT_OPTION_OPTIMIZATION_LEVEL,
3112 SPEED); 3112 SPEED);
3113 /* Gcc doesn't like being interrupted at all. */
3114 block_input ();
3115 sigset_t oldset; 3113 sigset_t oldset;
3116 sigset_t blocked;
3117 sigemptyset (&blocked);
3118 sigaddset (&blocked, SIGALRM);
3119 sigaddset (&blocked, SIGINT);
3120 sigaddset (&blocked, SIGIO);
3121 pthread_sigmask (SIG_BLOCK, &blocked, &oldset);
3122 3114
3115 if (!noninteractive)
3116 {
3117 sigset_t blocked;
3118 /* Gcc doesn't like being interrupted at all. */
3119 block_input ();
3120 sigemptyset (&blocked);
3121 sigaddset (&blocked, SIGALRM);
3122 sigaddset (&blocked, SIGINT);
3123 sigaddset (&blocked, SIGIO);
3124 pthread_sigmask (SIG_BLOCK, &blocked, &oldset);
3125 }
3123 emit_ctxt_code (); 3126 emit_ctxt_code ();
3124 3127
3125 /* Define inline functions. */ 3128 /* Define inline functions. */
@@ -3164,8 +3167,11 @@ DEFUN ("comp--compile-ctxt-to-file", Fcomp__compile_ctxt_to_file,
3164 Fdelete_file (out_file, Qnil); 3167 Fdelete_file (out_file, Qnil);
3165 Frename_file (tmp_file, out_file, Qnil); 3168 Frename_file (tmp_file, out_file, Qnil);
3166 3169
3167 pthread_sigmask (SIG_SETMASK, &oldset, 0); 3170 if (!noninteractive)
3168 unblock_input (); 3171 {
3172 pthread_sigmask (SIG_SETMASK, &oldset, 0);
3173 unblock_input ();
3174 }
3169 3175
3170 return out_file; 3176 return out_file;
3171} 3177}