aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2013-02-27 10:20:13 +0100
committerMichael Albinus2013-02-27 10:20:13 +0100
commitfa550654db66a9ea08d836e62dcac1d3ada86803 (patch)
treeb012397fd755e0019541e8ef8f16188efd478dbf
parent6e65b9ccff5999add7069b41c29aed499a2350f0 (diff)
downloademacs-fa550654db66a9ea08d836e62dcac1d3ada86803.tar.gz
emacs-fa550654db66a9ea08d836e62dcac1d3ada86803.zip
* net/tramp-adb.el (tramp-adb-parse-device-names)
(tramp-adb-maybe-open-connection): Add timeouts. (Bug#13299)
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/net/tramp-adb.el17
2 files changed, 14 insertions, 8 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index c5a902d6442..e69c6be3dcb 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12013-02-27 Michael Albinus <michael.albinus@gmx.de>
2
3 * net/tramp-adb.el (tramp-adb-parse-device-names)
4 (tramp-adb-maybe-open-connection): Add timeouts. (Bug#13299)
5
12013-02-26 Michael Albinus <michael.albinus@gmx.de> 62013-02-26 Michael Albinus <michael.albinus@gmx.de>
2 7
3 * net/tramp-sh.el (tramp-sh-handle-insert-directory): Add 8 * net/tramp-sh.el (tramp-sh-handle-insert-directory): Add
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el
index 0974c62c56e..809623280bc 100644
--- a/lisp/net/tramp-adb.el
+++ b/lisp/net/tramp-adb.el
@@ -157,13 +157,14 @@ pass to the OPERATION."
157;;;###tramp-autoload 157;;;###tramp-autoload
158(defun tramp-adb-parse-device-names (ignore) 158(defun tramp-adb-parse-device-names (ignore)
159 "Return a list of (nil host) tuples allowed to access." 159 "Return a list of (nil host) tuples allowed to access."
160 (with-temp-buffer 160 (with-timeout (10)
161 (when (zerop (call-process (tramp-adb-program) nil t nil "devices")) 161 (with-temp-buffer
162 (let (result) 162 (when (zerop (call-process (tramp-adb-program) nil t nil "devices"))
163 (goto-char (point-min)) 163 (let (result)
164 (while (search-forward-regexp "^\\(\\S-+\\)[[:space:]]+device$" nil t) 164 (goto-char (point-min))
165 (add-to-list 'result (list nil (match-string 1)))) 165 (while (search-forward-regexp "^\\(\\S-+\\)[[:space:]]+device$" nil t)
166 result)))) 166 (add-to-list 'result (list nil (match-string 1))))
167 result)))))
167 168
168(defun tramp-adb-handle-expand-file-name (name &optional dir) 169(defun tramp-adb-handle-expand-file-name (name &optional dir)
169 "Like `expand-file-name' for Tramp files." 170 "Like `expand-file-name' for Tramp files."
@@ -1106,7 +1107,7 @@ connection if a previous connection has died for some reason."
1106 (tramp-message 1107 (tramp-message
1107 vec 6 "%s" (mapconcat 'identity (process-command p) " ")) 1108 vec 6 "%s" (mapconcat 'identity (process-command p) " "))
1108 ;; Wait for initial prompt. 1109 ;; Wait for initial prompt.
1109 (tramp-adb-wait-for-output p) 1110 (tramp-adb-wait-for-output p 30)
1110 (unless (eq 'run (process-status p)) 1111 (unless (eq 'run (process-status p))
1111 (tramp-error vec 'file-error "Terminated!")) 1112 (tramp-error vec 'file-error "Terminated!"))
1112 (tramp-compat-set-process-query-on-exit-flag p nil) 1113 (tramp-compat-set-process-query-on-exit-flag p nil)