diff options
| -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, | |||
| 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 | } |