diff options
| author | Paul Eggert | 2018-01-20 19:12:05 -0800 |
|---|---|---|
| committer | Eli Zaretskii | 2018-11-15 16:45:36 +0200 |
| commit | a306d0397427870afea584233942e40cd78d16f7 (patch) | |
| tree | 860ee617aa1c611b62b6ba000c68b90aee4b56ca | |
| parent | edcd6b722c8e495498b1619e4d073962b8a8f3e8 (diff) | |
| download | emacs-a306d0397427870afea584233942e40cd78d16f7.tar.gz emacs-a306d0397427870afea584233942e40cd78d16f7.zip | |
Fix tempfile creation when byte compiling
This improves on the recent fix for master failing to build
on FreeBSD. Suggested by Stefan Monnier in:
https://lists.gnu.org/r/emacs-devel/2018-01/msg00600.html
* lisp/emacs-lisp/bytecomp.el (byte-compile-file):
Put tempfile next to the target file, as was the original intent.
(cherry picked from commit 64c846738617d1d037eac0cefb6586c04317b0a1)
| -rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 68e2fd1d104..bc65f2cfaf0 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el | |||
| @@ -1938,17 +1938,7 @@ The value is non-nil if there were no errors, nil if errors." | |||
| 1938 | ;; parallel bootstrap), it does not risk getting a | 1938 | ;; parallel bootstrap), it does not risk getting a |
| 1939 | ;; half-finished file. (Bug#4196) | 1939 | ;; half-finished file. (Bug#4196) |
| 1940 | (tempfile | 1940 | (tempfile |
| 1941 | (if (file-name-absolute-p target-file) | 1941 | (make-temp-file (expand-file-name target-file))) |
| 1942 | (make-temp-file target-file) | ||
| 1943 | ;; If target-file is relative and includes | ||
| 1944 | ;; leading directories, make-temp-file will | ||
| 1945 | ;; assume those leading directories exist | ||
| 1946 | ;; under temporary-file-directory, which might | ||
| 1947 | ;; not be true. So strip leading directories | ||
| 1948 | ;; from relative file names before calling | ||
| 1949 | ;; make-temp-file. | ||
| 1950 | (make-temp-file | ||
| 1951 | (file-name-nondirectory target-file)))) | ||
| 1952 | (default-modes (default-file-modes)) | 1942 | (default-modes (default-file-modes)) |
| 1953 | (temp-modes (logand default-modes #o600)) | 1943 | (temp-modes (logand default-modes #o600)) |
| 1954 | (desired-modes (logand default-modes #o666)) | 1944 | (desired-modes (logand default-modes #o666)) |