From fa550654db66a9ea08d836e62dcac1d3ada86803 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Wed, 27 Feb 2013 10:20:13 +0100 Subject: [PATCH] * net/tramp-adb.el (tramp-adb-parse-device-names) (tramp-adb-maybe-open-connection): Add timeouts. (Bug#13299) --- lisp/ChangeLog | 5 +++++ lisp/net/tramp-adb.el | 17 +++++++++-------- 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 @@ +2013-02-27 Michael Albinus + + * net/tramp-adb.el (tramp-adb-parse-device-names) + (tramp-adb-maybe-open-connection): Add timeouts. (Bug#13299) + 2013-02-26 Michael Albinus * 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." ;;;###tramp-autoload (defun tramp-adb-parse-device-names (ignore) "Return a list of (nil host) tuples allowed to access." - (with-temp-buffer - (when (zerop (call-process (tramp-adb-program) nil t nil "devices")) - (let (result) - (goto-char (point-min)) - (while (search-forward-regexp "^\\(\\S-+\\)[[:space:]]+device$" nil t) - (add-to-list 'result (list nil (match-string 1)))) - result)))) + (with-timeout (10) + (with-temp-buffer + (when (zerop (call-process (tramp-adb-program) nil t nil "devices")) + (let (result) + (goto-char (point-min)) + (while (search-forward-regexp "^\\(\\S-+\\)[[:space:]]+device$" nil t) + (add-to-list 'result (list nil (match-string 1)))) + result))))) (defun tramp-adb-handle-expand-file-name (name &optional dir) "Like `expand-file-name' for Tramp files." @@ -1106,7 +1107,7 @@ connection if a previous connection has died for some reason." (tramp-message vec 6 "%s" (mapconcat 'identity (process-command p) " ")) ;; Wait for initial prompt. - (tramp-adb-wait-for-output p) + (tramp-adb-wait-for-output p 30) (unless (eq 'run (process-status p)) (tramp-error vec 'file-error "Terminated!")) (tramp-compat-set-process-query-on-exit-flag p nil) -- 2.39.2