1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

* net/tramp-adb.el (tramp-adb-maybe-open-connection): Cache,

whether the "su" command is available on the device.
This commit is contained in:
Michael Albinus 2013-03-03 11:31:01 +01:00
parent 50d8b29da3
commit 9a0f9ec39a
2 changed files with 15 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2013-03-03 Michael Albinus <michael.albinus@gmx.de>
* net/tramp-adb.el (tramp-adb-maybe-open-connection): Cache,
whether the "su" command is available on the device.
2013-03-01 Michael Albinus <michael.albinus@gmx.de>
* net/tramp-adb.el (tramp-adb-prompt): Extend regexp.

View file

@ -1074,6 +1074,13 @@ connection if a previous connection has died for some reason."
(host (tramp-file-name-host vec))
(user (tramp-file-name-user vec))
(devices (mapcar 'cadr (tramp-adb-parse-device-names nil))))
;; Maybe we know already that "su" is not supported. We cannot
;; use a connection property, because we have not checked yet
;; whether it is still the same device.
(when (and user (not (tramp-get-file-property vec "" "su-command-p" t)))
(tramp-error vec 'file-error "Cannot switch to user `%s'" user))
(unless
(and p (processp p) (memq (process-status p) '(run open)))
(save-match-data
@ -1133,7 +1140,9 @@ connection if a previous connection has died for some reason."
(tramp-adb-send-command vec (format "su %s" user))
(unless (zerop (tramp-adb-command-exit-status vec nil))
(delete-process p)
(tramp-error vec 'file-error "Cannot switch to user %s" user)))
(tramp-set-file-property vec "" "su-command-p" nil)
(tramp-error
vec 'file-error "Cannot switch to user `%s'" user)))
;; Set "remote-path" connection property. This is needed
;; for eshell.