aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJürgen Hötzel2012-12-31 16:29:23 +0100
committerMichael Albinus2012-12-31 16:29:23 +0100
commit1a82330cc569deda2b37b228d7a16ec6fb65f67a (patch)
tree2d79026c13a54eb4840f611ab9502156977c113b
parent27fcfe31010c45f2e87ce51fa2fe99183731e261 (diff)
downloademacs-1a82330cc569deda2b37b228d7a16ec6fb65f67a.tar.gz
emacs-1a82330cc569deda2b37b228d7a16ec6fb65f67a.zip
* net/tramp-adb.el (tramp-adb-maybe-open-connection): Handle errors
(No device connected, invalid device name). (Bug #13299)
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/net/tramp-adb.el15
2 files changed, 19 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 88200a27133..7e9e9d7738e 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12012-12-31 Jürgen Hötzel <juergen@archlinux.org>
2
3 * net/tramp-adb.el (tramp-adb-maybe-open-connection): Handle errors
4 (No device connected, invalid device name). (Bug #13299)
5
12012-12-31 Martin Rudalics <rudalics@gmx.at> 62012-12-31 Martin Rudalics <rudalics@gmx.at>
2 7
3 * window.el (window-resizable--p): Rename to window-resizable-p. 8 * window.el (window-resizable--p): Rename to window-resizable-p.
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el
index f31bd6b3d2d..b418d1982d9 100644
--- a/lisp/net/tramp-adb.el
+++ b/lisp/net/tramp-adb.el
@@ -998,11 +998,24 @@ COMMAND is nil, just sends `echo $?'. Returns the exit status found."
998Does not do anything if a connection is already open, but re-opens the 998Does not do anything if a connection is already open, but re-opens the
999connection if a previous connection has died for some reason." 999connection if a previous connection has died for some reason."
1000 (let* ((buf (tramp-get-connection-buffer vec)) 1000 (let* ((buf (tramp-get-connection-buffer vec))
1001 (p (get-buffer-process buf))) 1001 (p (get-buffer-process buf))
1002 (devices (mapcar 'cadr (tramp-adb-parse-device-names nil))))
1002 (unless 1003 (unless
1003 (and p (processp p) (memq (process-status p) '(run open))) 1004 (and p (processp p) (memq (process-status p) '(run open)))
1004 (save-match-data 1005 (save-match-data
1005 (when (and p (processp p)) (delete-process p)) 1006 (when (and p (processp p)) (delete-process p))
1007 (if (not devices)
1008 (tramp-error vec 'file-error "No device connected"))
1009 (if (and (tramp-file-name-host vec)
1010 (not (member (tramp-file-name-host vec) devices)))
1011 (tramp-error
1012 vec 'file-error
1013 "Device %s not connected" (tramp-file-name-host vec)))
1014 (if (and (not (eq (length devices) 1))
1015 (not (tramp-file-name-host vec)))
1016 (tramp-error
1017 vec 'file-error
1018 "Multiple Devices connected: No Host/Device specified"))
1006 (with-tramp-progress-reporter vec 3 "Opening adb shell connection" 1019 (with-tramp-progress-reporter vec 3 "Opening adb shell connection"
1007 (let* ((coding-system-for-read 'utf-8-dos) ;is this correct? 1020 (let* ((coding-system-for-read 'utf-8-dos) ;is this correct?
1008 (process-connection-type tramp-process-connection-type) 1021 (process-connection-type tramp-process-connection-type)