1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-02-01 13:21:11 -08:00

(backup-buffer-copy): Revert 2007-08-22 change.

This commit is contained in:
Glenn Morris 2007-08-24 03:07:45 +00:00
parent d25b54b37c
commit 46b0d02912
2 changed files with 5 additions and 10 deletions

View file

@ -1,3 +1,8 @@
2007-08-24 Ulrich Mueller <ulm@gentoo.org> (tiny change)
* files.el (backup-buffer-copy): Don't wrap delete in
condition-case, only try to delete if file exists.
2007-08-24 Glenn Morris <rgm@gnu.org>
* files.el (backup-buffer-copy): Revert 2007-08-22 change.

View file

@ -3175,9 +3175,6 @@ BACKUPNAME is the backup file name, which is the old file renamed."
(let ((umask (default-file-modes))
(dir (or (file-name-directory to-name)
default-directory)))
;; Can't delete or create files in a read-only directory.
(unless (file-writable-p dir)
(signal 'file-error (list "Directory is not writable" dir)))
(unwind-protect
(progn
;; Create temp files with strict access rights. It's easy to
@ -3186,11 +3183,6 @@ BACKUPNAME is the backup file name, which is the old file renamed."
(set-default-file-modes ?\700)
(while (condition-case ()
(progn
;; If we allow for the possibility of something
;; creating the file between delete and copy
;; (below), we must also allow for the
;; possibility of something deleting it between
;; a file-exists-p check and a delete.
(condition-case nil
(delete-file to-name)
(file-error nil))
@ -3199,8 +3191,6 @@ BACKUPNAME is the backup file name, which is the old file renamed."
(file-already-exists t))
;; The file was somehow created by someone else between
;; `delete-file' and `copy-file', so let's try again.
;; Does that every actually happen in practice?
;; This is a potential infloop, which seems bad...
;; rms says "I think there is also a possible race
;; condition for making backup files" (emacs-devel 20070821).
nil))