emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r111886: * net/tramp-adb.el (tramp-ad


From: Michael Albinus
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r111886: * net/tramp-adb.el (tramp-adb-parse-device-names)
Date: Wed, 27 Feb 2013 10:20:13 +0100
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 111886
committer: Michael Albinus <address@hidden
branch nick: trunk
timestamp: Wed 2013-02-27 10:20:13 +0100
message:
  * net/tramp-adb.el (tramp-adb-parse-device-names)
  (tramp-adb-maybe-open-connection): Add timeouts.  (Bug#13299)
modified:
  lisp/ChangeLog
  lisp/net/tramp-adb.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-02-26 08:46:38 +0000
+++ b/lisp/ChangeLog    2013-02-27 09:20:13 +0000
@@ -1,3 +1,8 @@
+2013-02-27  Michael Albinus  <address@hidden>
+
+       * net/tramp-adb.el (tramp-adb-parse-device-names)
+       (tramp-adb-maybe-open-connection): Add timeouts.  (Bug#13299)
+
 2013-02-26  Michael Albinus  <address@hidden>
 
        * net/tramp-sh.el (tramp-sh-handle-insert-directory): Add

=== modified file 'lisp/net/tramp-adb.el'
--- a/lisp/net/tramp-adb.el     2013-02-12 14:35:10 +0000
+++ b/lisp/net/tramp-adb.el     2013-02-27 09:20:13 +0000
@@ -157,13 +157,14 @@
 ;;;###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 @@
            (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)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]