diff options
| author | Miles Bader | 2001-08-21 17:01:57 +0000 |
|---|---|---|
| committer | Miles Bader | 2001-08-21 17:01:57 +0000 |
| commit | e4cf159b2a2f40518578e57287cd91c6f651fd00 (patch) | |
| tree | f51945a7f88661c97b0e03d39aa0225c64e1f71c | |
| parent | 9ed462b73c7717efde102190200f8581d043057c (diff) | |
| download | emacs-e4cf159b2a2f40518578e57287cd91c6f651fd00.tar.gz emacs-e4cf159b2a2f40518578e57287cd91c6f651fd00.zip | |
(byte-compile-file): Remove TARGET-FILE before writing it, so that
hard-links don't see new version.
| -rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index ae74752d9e6..7e6fbeea10c 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; bytecomp.el --- compilation of Lisp code into byte code | 1 | ;;; bytecomp.el --- compilation of Lisp code into byte code |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1985, 1986, 1987, 1992, 1994, 1998, 2000 | 3 | ;; Copyright (C) 1985, 1986, 1987, 1992, 1994, 1998, 2000, 2001 |
| 4 | ;; Free Software Foundation, Inc. | 4 | ;; Free Software Foundation, Inc. |
| 5 | 5 | ||
| 6 | ;; Author: Jamie Zawinski <jwz@lucid.com> | 6 | ;; Author: Jamie Zawinski <jwz@lucid.com> |
| @@ -10,7 +10,7 @@ | |||
| 10 | 10 | ||
| 11 | ;;; This version incorporates changes up to version 2.10 of the | 11 | ;;; This version incorporates changes up to version 2.10 of the |
| 12 | ;;; Zawinski-Furuseth compiler. | 12 | ;;; Zawinski-Furuseth compiler. |
| 13 | (defconst byte-compile-version "$Revision: 2.83 $") | 13 | (defconst byte-compile-version "$Revision: 2.84 $") |
| 14 | 14 | ||
| 15 | ;; This file is part of GNU Emacs. | 15 | ;; This file is part of GNU Emacs. |
| 16 | 16 | ||
| @@ -1406,6 +1406,13 @@ The value is t if there were no errors, nil if errors." | |||
| 1406 | (let ((coding-system-for-write 'no-conversion)) | 1406 | (let ((coding-system-for-write 'no-conversion)) |
| 1407 | (if (or (eq system-type 'ms-dos) (eq system-type 'windows-nt)) | 1407 | (if (or (eq system-type 'ms-dos) (eq system-type 'windows-nt)) |
| 1408 | (setq buffer-file-type t)) | 1408 | (setq buffer-file-type t)) |
| 1409 | (when (file-exists-p target-file) | ||
| 1410 | ;; Remove the target before writing it, so that any | ||
| 1411 | ;; hard-links continue to point to the old file (this makes | ||
| 1412 | ;; it possible for installed files to share disk space with | ||
| 1413 | ;; the build tree, without causing problems when emacs-lisp | ||
| 1414 | ;; files in the build tree are recompiled). | ||
| 1415 | (delete-file target-file)) | ||
| 1409 | (write-region 1 (point-max) target-file)) | 1416 | (write-region 1 (point-max) target-file)) |
| 1410 | ;; This is just to give a better error message than | 1417 | ;; This is just to give a better error message than |
| 1411 | ;; write-region | 1418 | ;; write-region |