Avoid race condition in parallel native-compilation
* lisp/emacs-lisp/comp.el (comp-delete-or-replace-file): Avoid race condition by relying on 'rename-file' being an atomic operation on Posix filesystems. (Bug#68083)
This commit is contained in:
parent
69c98b0e70
commit
6e2e34a5ca
1 changed files with 3 additions and 3 deletions
|
@ -3339,9 +3339,9 @@ session."
|
|||
;; Remove the old eln instead of copying the new one into it
|
||||
;; to get a new inode and prevent crashes in case the old one
|
||||
;; is currently loaded.
|
||||
(t (delete-file oldfile)
|
||||
(when newfile
|
||||
(rename-file newfile oldfile)))))
|
||||
(t (if newfile
|
||||
(rename-file newfile oldfile t)
|
||||
(delete-file oldfile)))))
|
||||
|
||||
(defun comp--native-compile (function-or-file &optional with-late-load output)
|
||||
"Compile FUNCTION-OR-FILE into native code.
|
||||
|
|
Loading…
Add table
Reference in a new issue