From c6c05e2aa9d28a74df0b61b4f56745f1248a779e Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 19 Jan 2018 17:31:54 +0200 Subject: Unbreak building Emacs on FreeBSD * lisp/emacs-lisp/bytecomp.el (byte-compile-file): Don't create the temporary file under temporary-file-directory if the file being compiled is specified by an absolute file name. This avoids problems with ACL copying from temporary-file-directory on FreeBSD. For the details, see http://lists.gnu.org/archive/html/emacs-devel/2018-01/msg00513.html. --- lisp/emacs-lisp/bytecomp.el | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'lisp/emacs-lisp/bytecomp.el') diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index acba9e2df5e..3c9c62eb23d 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -1933,7 +1933,17 @@ The value is non-nil if there were no errors, nil if errors." ;; parallel bootstrap), it does not risk getting a ;; half-finished file. (Bug#4196) (tempfile - (make-temp-file (file-name-nondirectory target-file))) + ;; If target-file is relative and includes + ;; leading directories, make-temp-file will + ;; assume those leading directories exist + ;; under temporary-file-directory, which might + ;; not be true. So strip leading directories + ;; from relative file names before calling + ;; make-temp-file. + (if (file-name-absolute-p target-file) + (make-temp-file target-file) + (make-temp-file + (file-name-nondirectory target-file)))) (default-modes (default-file-modes)) (temp-modes (logand default-modes #o600)) (desired-modes (logand default-modes #o666)) -- cgit v1.2.1