diff options
| author | Glenn Morris | 2007-08-24 03:07:35 +0000 |
|---|---|---|
| committer | Glenn Morris | 2007-08-24 03:07:35 +0000 |
| commit | c2357926468a7335f785de9cee3cf1bbb98a1bd8 (patch) | |
| tree | 1828a5ffaa2ca4285ef3edbe1bb0c73860ed7358 | |
| parent | 2933cd39a60a0fa6564ff955c1ff8adeace00716 (diff) | |
| download | emacs-c2357926468a7335f785de9cee3cf1bbb98a1bd8.tar.gz emacs-c2357926468a7335f785de9cee3cf1bbb98a1bd8.zip | |
(backup-buffer-copy): Revert 2007-08-22 change.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/files.el | 10 |
2 files changed, 5 insertions, 10 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3f77b64753b..0703d5134c9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2007-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 | |||
| 1 | 2007-08-24 Glenn Morris <rgm@gnu.org> | 6 | 2007-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 8281a18b34f..dab90097119 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -3123,9 +3123,6 @@ BACKUPNAME is the backup file name, which is the old file renamed." | |||
| 3123 | (let ((umask (default-file-modes)) | 3123 | (let ((umask (default-file-modes)) |
| 3124 | (dir (or (file-name-directory to-name) | 3124 | (dir (or (file-name-directory to-name) |
| 3125 | default-directory))) | 3125 | default-directory))) |
| 3126 | ;; Can't delete or create files in a read-only directory. | ||
| 3127 | (unless (file-writable-p dir) | ||
| 3128 | (signal 'file-error (list "Directory is not writable" dir))) | ||
| 3129 | (unwind-protect | 3126 | (unwind-protect |
| 3130 | (progn | 3127 | (progn |
| 3131 | ;; Create temp files with strict access rights. It's easy to | 3128 | ;; Create temp files with strict access rights. It's easy to |
| @@ -3134,11 +3131,6 @@ BACKUPNAME is the backup file name, which is the old file renamed." | |||
| 3134 | (set-default-file-modes ?\700) | 3131 | (set-default-file-modes ?\700) |
| 3135 | (while (condition-case () | 3132 | (while (condition-case () |
| 3136 | (progn | 3133 | (progn |
| 3137 | ;; If we allow for the possibility of something | ||
| 3138 | ;; creating the file between delete and copy | ||
| 3139 | ;; (below), we must also allow for the | ||
| 3140 | ;; possibility of something deleting it between | ||
| 3141 | ;; a file-exists-p check and a delete. | ||
| 3142 | (condition-case nil | 3134 | (condition-case nil |
| 3143 | (delete-file to-name) | 3135 | (delete-file to-name) |
| 3144 | (file-error nil)) | 3136 | (file-error nil)) |
| @@ -3147,8 +3139,6 @@ BACKUPNAME is the backup file name, which is the old file renamed." | |||
| 3147 | (file-already-exists t)) | 3139 | (file-already-exists t)) |
| 3148 | ;; The file was somehow created by someone else between | 3140 | ;; The file was somehow created by someone else between |
| 3149 | ;; `delete-file' and `copy-file', so let's try again. | 3141 | ;; `delete-file' and `copy-file', so let's try again. |
| 3150 | ;; Does that every actually happen in practice? | ||
| 3151 | ;; This is a potential infloop, which seems bad... | ||
| 3152 | ;; rms says "I think there is also a possible race | 3142 | ;; rms says "I think there is also a possible race |
| 3153 | ;; condition for making backup files" (emacs-devel 20070821). | 3143 | ;; condition for making backup files" (emacs-devel 20070821). |
| 3154 | nil)) | 3144 | nil)) |