From: Andrea Corallo Date: Mon, 30 Dec 2019 23:19:22 +0000 (+0100) Subject: compile each eln to a temporary one and rename it as last X-Git-Tag: emacs-28.0.90~2727^2~859 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c4b886831acb82643a38f48c91456b15363bed75;p=emacs.git compile each eln to a temporary one and rename it as last --- diff --git a/src/comp.c b/src/comp.c index 7d4bcc2cdff..c25b3245ca3 100644 --- a/src/comp.c +++ b/src/comp.c @@ -3151,15 +3151,18 @@ DEFUN ("comp--compile-ctxt-to-file", Fcomp__compile_ctxt_to_file, AUTO_STRING (dot_so, NATIVE_ELISP_SUFFIX); Lisp_Object out_file = CALLN (Fconcat, ctxtname, dot_so); + Lisp_Object tmp_file = + Fmake_temp_file_internal (ctxtname, Qnil, dot_so, Qnil); + gcc_jit_context_compile_to_file (comp.ctxt, + GCC_JIT_OUTPUT_KIND_DYNAMIC_LIBRARY, + SSDATA (tmp_file)); - /* Remove the old eln before creating the new one to get a new inode and - prevent crashes in case the old one is currently loaded. */ + /* Remove the old eln instead of copying the new one into ti to get + a new inode and prevent crashes in case the old one is currently + loaded. */ if (!NILP (Ffile_exists_p (out_file))) Fdelete_file (out_file, Qnil); - - gcc_jit_context_compile_to_file (comp.ctxt, - GCC_JIT_OUTPUT_KIND_DYNAMIC_LIBRARY, - SSDATA (out_file)); + Frename_file (tmp_file, out_file, Qnil); pthread_sigmask (SIG_SETMASK, &oldset, 0); unblock_input ();