aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/files.el10
2 files changed, 5 insertions, 10 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index f1b082c618f..cac2d1c269f 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12007-08-24 Ulrich Mueller <ulm@gentoo.org> (tiny change)
2
3 * files.el (backup-buffer-copy): Don't wrap delete in
4 condition-case, only try to delete if file exists.
5
12007-08-24 Glenn Morris <rgm@gnu.org> 62007-08-24 Glenn Morris <rgm@gnu.org>
2 7
3 * files.el (backup-buffer-copy): Revert 2007-08-22 change. 8 * files.el (backup-buffer-copy): Revert 2007-08-22 change.
diff --git a/lisp/files.el b/lisp/files.el
index 1cc46684d4b..614cad467ef 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -3175,9 +3175,6 @@ BACKUPNAME is the backup file name, which is the old file renamed."
3175 (let ((umask (default-file-modes)) 3175 (let ((umask (default-file-modes))
3176 (dir (or (file-name-directory to-name) 3176 (dir (or (file-name-directory to-name)
3177 default-directory))) 3177 default-directory)))
3178 ;; Can't delete or create files in a read-only directory.
3179 (unless (file-writable-p dir)
3180 (signal 'file-error (list "Directory is not writable" dir)))
3181 (unwind-protect 3178 (unwind-protect
3182 (progn 3179 (progn
3183 ;; Create temp files with strict access rights. It's easy to 3180 ;; 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."
3186 (set-default-file-modes ?\700) 3183 (set-default-file-modes ?\700)
3187 (while (condition-case () 3184 (while (condition-case ()
3188 (progn 3185 (progn
3189 ;; If we allow for the possibility of something
3190 ;; creating the file between delete and copy
3191 ;; (below), we must also allow for the
3192 ;; possibility of something deleting it between
3193 ;; a file-exists-p check and a delete.
3194 (condition-case nil 3186 (condition-case nil
3195 (delete-file to-name) 3187 (delete-file to-name)
3196 (file-error nil)) 3188 (file-error nil))
@@ -3199,8 +3191,6 @@ BACKUPNAME is the backup file name, which is the old file renamed."
3199 (file-already-exists t)) 3191 (file-already-exists t))
3200 ;; The file was somehow created by someone else between 3192 ;; The file was somehow created by someone else between
3201 ;; `delete-file' and `copy-file', so let's try again. 3193 ;; `delete-file' and `copy-file', so let's try again.
3202 ;; Does that every actually happen in practice?
3203 ;; This is a potential infloop, which seems bad...
3204 ;; rms says "I think there is also a possible race 3194 ;; rms says "I think there is also a possible race
3205 ;; condition for making backup files" (emacs-devel 20070821). 3195 ;; condition for making backup files" (emacs-devel 20070821).
3206 nil)) 3196 nil))