]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve error handling in tramp-adb.el
authorMichael Albinus <michael.albinus@gmx.de>
Sun, 21 Jun 2015 18:36:14 +0000 (20:36 +0200)
committerMichael Albinus <michael.albinus@gmx.de>
Sun, 21 Jun 2015 18:36:14 +0000 (20:36 +0200)
* lisp/net/tramp-adb.el (tramp-adb-handle-file-local-copy):
Improve error handling.

lisp/net/tramp-adb.el

index 7c509e1d098d0f71ab5e35a40f67386f8574bc69..6305921857928d819ece6ebc0a00e48619382806 100644 (file)
@@ -575,8 +575,10 @@ Emacs dired can't find files."
     (let ((tmpfile (tramp-compat-make-temp-file filename)))
       (with-tramp-progress-reporter
          v 3 (format "Fetching %s to tmp file %s" filename tmpfile)
-       (when (tramp-adb-execute-adb-command v "pull" localname tmpfile)
-         (delete-file tmpfile)
+       ;; "adb pull ..." does not always return an error code.
+       (when (or (tramp-adb-execute-adb-command v "pull" localname tmpfile)
+                 (not (file-exists-p tmpfile)))
+         (ignore-errors (delete-file tmpfile))
          (tramp-error
           v 'file-error "Cannot make local copy of file `%s'" filename))
        (set-file-modes