diff options
| -rw-r--r-- | lisp/ChangeLog | 10 | ||||
| -rw-r--r-- | lisp/net/tramp-smb.el | 25 |
2 files changed, 26 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1437ddeed07..1009a381222 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,13 @@ | |||
| 1 | 2009-01-05 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * net/tramp.el (tramp-handle-load) | ||
| 4 | (tramp-do-copy-or-rename-file-directly) | ||
| 5 | (tramp-handle-file-local-copy, tramp-handle-insert-file-contents) | ||
| 6 | (tramp-handle-write-region) | ||
| 7 | * net/tramp-smb.el (tramp-smb-handle-copy-file) | ||
| 8 | (tramp-smb-handle-rename-file, tramp-smb-handle-write-region): | ||
| 9 | Delete temporary file in case of error. | ||
| 10 | |||
| 1 | 2009-01-05 Agustín Martín <agustin.martin@hispalinux.es> | 11 | 2009-01-05 Agustín Martín <agustin.martin@hispalinux.es> |
| 2 | 12 | ||
| 3 | * textmodes/ispell.el (ispell-check-version): Use (with-temp-buffer) | 13 | * textmodes/ispell.el (ispell-check-version): Use (with-temp-buffer) |
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index 4ce8aa7fce6..b9dc8731215 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el | |||
| @@ -216,7 +216,10 @@ PRESERVE-UID-GID is completely ignored." | |||
| 216 | 216 | ||
| 217 | (if tmpfile | 217 | (if tmpfile |
| 218 | ;; Remote filename. | 218 | ;; Remote filename. |
| 219 | (rename-file tmpfile newname ok-if-already-exists) | 219 | (condition-case err |
| 220 | (rename-file tmpfile newname ok-if-already-exists) | ||
| 221 | (error (delete-file tmpfile) | ||
| 222 | (signal (car err) (cdr err)))) | ||
| 220 | 223 | ||
| 221 | ;; Remote newname. | 224 | ;; Remote newname. |
| 222 | (when (file-directory-p newname) | 225 | (when (file-directory-p newname) |
| @@ -548,10 +551,13 @@ PRESERVE-UID-GID is completely ignored." | |||
| 548 | (let ((tmpfile (file-local-copy filename))) | 551 | (let ((tmpfile (file-local-copy filename))) |
| 549 | 552 | ||
| 550 | (if tmpfile | 553 | (if tmpfile |
| 551 | ;; remote filename | 554 | ;; Remote filename. |
| 552 | (rename-file tmpfile newname ok-if-already-exists) | 555 | (condition-case err |
| 556 | (rename-file tmpfile newname ok-if-already-exists) | ||
| 557 | (error (delete-file tmpfile) | ||
| 558 | (signal (car err) (cdr err)))) | ||
| 553 | 559 | ||
| 554 | ;; remote newname | 560 | ;; Remote newname. |
| 555 | (when (file-directory-p newname) | 561 | (when (file-directory-p newname) |
| 556 | (setq newname (expand-file-name | 562 | (setq newname (expand-file-name |
| 557 | (file-name-nondirectory filename) newname))) | 563 | (file-name-nondirectory filename) newname))) |
| @@ -618,12 +624,13 @@ errors for shares like \"C$/\", which are common in Microsoft Windows." | |||
| 618 | (list start end tmpfile append 'no-message lockname))) | 624 | (list start end tmpfile append 'no-message lockname))) |
| 619 | 625 | ||
| 620 | (tramp-message v 5 "Writing tmp file %s to file %s..." tmpfile filename) | 626 | (tramp-message v 5 "Writing tmp file %s to file %s..." tmpfile filename) |
| 621 | (if (tramp-smb-send-command v (format "put %s \"%s\"" tmpfile file)) | 627 | (unwind-protect |
| 622 | (tramp-message | 628 | (if (tramp-smb-send-command v (format "put %s \"%s\"" tmpfile file)) |
| 623 | v 5 "Writing tmp file %s to file %s...done" tmpfile filename) | 629 | (tramp-message |
| 624 | (tramp-error v 'file-error "Cannot write `%s'" filename)) | 630 | v 5 "Writing tmp file %s to file %s...done" tmpfile filename) |
| 631 | (tramp-error v 'file-error "Cannot write `%s'" filename)) | ||
| 632 | (delete-file tmpfile)) | ||
| 625 | 633 | ||
| 626 | (delete-file tmpfile) | ||
| 627 | (unless (equal curbuf (current-buffer)) | 634 | (unless (equal curbuf (current-buffer)) |
| 628 | (tramp-error | 635 | (tramp-error |
| 629 | v 'file-error | 636 | v 'file-error |