diff options
author | Andrea Corallo <akrl@sdf.org> | 2020-01-02 22:14:25 +0100 |
---|---|---|
committer | Andrea Corallo <akrl@sdf.org> | 2020-01-02 23:01:33 +0100 |
commit | 3039c55642fbb2feb577e057ee167c2cedc12feb (patch) | |
tree | 7742e3c485f9982d4daa93d49eb6e6994675e064 /src/comp.c | |
parent | 5252b59b2b3a7959160378cbd0ecb09d9a1da24b (diff) | |
download | emacs-3039c55642fbb2feb577e057ee167c2cedc12feb.tar.gz emacs-3039c55642fbb2feb577e057ee167c2cedc12feb.tar.bz2 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.c | 26 |
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, gcc_jit_context_set_int_option (comp.ctxt, GCC_JIT_INT_OPTION_OPTIMIZATION_LEVEL, SPEED); - /* Gcc doesn't like being interrupted at all. */ - block_input (); sigset_t oldset; - sigset_t blocked; - sigemptyset (&blocked); - sigaddset (&blocked, SIGALRM); - sigaddset (&blocked, SIGINT); - sigaddset (&blocked, SIGIO); - pthread_sigmask (SIG_BLOCK, &blocked, &oldset); + if (!noninteractive) + { + sigset_t blocked; + /* Gcc doesn't like being interrupted at all. */ + block_input (); + sigemptyset (&blocked); + sigaddset (&blocked, SIGALRM); + sigaddset (&blocked, SIGINT); + sigaddset (&blocked, SIGIO); + pthread_sigmask (SIG_BLOCK, &blocked, &oldset); + } emit_ctxt_code (); /* Define inline functions. */ @@ -3164,8 +3167,11 @@ DEFUN ("comp--compile-ctxt-to-file", Fcomp__compile_ctxt_to_file, Fdelete_file (out_file, Qnil); Frename_file (tmp_file, out_file, Qnil); - pthread_sigmask (SIG_SETMASK, &oldset, 0); - unblock_input (); + if (!noninteractive) + { + pthread_sigmask (SIG_SETMASK, &oldset, 0); + unblock_input (); + } return out_file; } |