1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-25 07:28:20 +00:00

* net/tramp-adb.el (tramp-adb-maybe-open-connection): Handle errors

(No device connected, invalid device name). (Bug #13299)
This commit is contained in:
Jürgen Hötzel 2012-12-31 16:29:23 +01:00 committed by Michael Albinus
parent 27fcfe3101
commit 1a82330cc5
2 changed files with 19 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2012-12-31 Jürgen Hötzel <juergen@archlinux.org>
* net/tramp-adb.el (tramp-adb-maybe-open-connection): Handle errors
(No device connected, invalid device name). (Bug #13299)
2012-12-31 Martin Rudalics <rudalics@gmx.at>
* window.el (window-resizable--p): Rename to window-resizable-p.

View File

@ -998,11 +998,24 @@ COMMAND is nil, just sends `echo $?'. Returns the exit status found."
Does not do anything if a connection is already open, but re-opens the
connection if a previous connection has died for some reason."
(let* ((buf (tramp-get-connection-buffer vec))
(p (get-buffer-process buf)))
(p (get-buffer-process buf))
(devices (mapcar 'cadr (tramp-adb-parse-device-names nil))))
(unless
(and p (processp p) (memq (process-status p) '(run open)))
(save-match-data
(when (and p (processp p)) (delete-process p))
(if (not devices)
(tramp-error vec 'file-error "No device connected"))
(if (and (tramp-file-name-host vec)
(not (member (tramp-file-name-host vec) devices)))
(tramp-error
vec 'file-error
"Device %s not connected" (tramp-file-name-host vec)))
(if (and (not (eq (length devices) 1))
(not (tramp-file-name-host vec)))
(tramp-error
vec 'file-error
"Multiple Devices connected: No Host/Device specified"))
(with-tramp-progress-reporter vec 3 "Opening adb shell connection"
(let* ((coding-system-for-read 'utf-8-dos) ;is this correct?
(process-connection-type tramp-process-connection-type)