summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/comp.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/emacs-lisp/comp.el')
-rw-r--r--lisp/emacs-lisp/comp.el10
1 files changed, 6 insertions, 4 deletions
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index dd5ad5a440b..74b0b1197be 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -4213,11 +4213,13 @@ variable 'NATIVE_DISABLED' is set, only byte compile."
(batch-byte-compile)
(cl-assert (length= command-line-args-left 1))
(let ((byte+native-compile t)
- (byte-to-native-output-file nil))
+ (byte-to-native-output-buffer-file nil))
(batch-native-compile)
- (pcase byte-to-native-output-file
- (`(,tempfile . ,target-file)
- (rename-file tempfile target-file t)))
+ (pcase byte-to-native-output-buffer-file
+ (`(,temp-buffer . ,target-file)
+ (unwind-protect
+ (byte-write-target-file temp-buffer target-file))
+ (kill-buffer temp-buffer)))
(setq command-line-args-left (cdr command-line-args-left)))))
;;;###autoload