]> git.eshelyaron.com Git - emacs.git/commitdiff
* net/tramp-adb.el (tramp-adb-parse-device-names): Use
authorMichael Albinus <michael.albinus@gmx.de>
Sun, 17 Mar 2013 17:23:05 +0000 (18:23 +0100)
committerMichael Albinus <michael.albinus@gmx.de>
Sun, 17 Mar 2013 17:23:05 +0000 (18:23 +0100)
`start-process' instead of `call-process'.  Otherwise, the
function might be blocked under MS Windows.

lisp/ChangeLog
lisp/net/tramp-adb.el

index 3c771a893caf18ec1b10328ad7a99625a4e6c8d3..ae7d7576592b8f18bf9129ccbbfba7e691e592c8 100644 (file)
@@ -1,3 +1,9 @@
+2013-03-17  Michael Albinus  <michael.albinus@gmx.de>
+
+       * net/tramp-adb.el (tramp-adb-parse-device-names): Use
+       `start-process' instead of `call-process'.  Otherwise, the
+       function might be blocked under MS Windows.
+
 2013-03-17  Leo Liu  <sdl.web@gmail.com>
 
        Extend eldoc to display info in the mode-line.  (Bug#13978)
index 2d683a4d3d21b7685b989c4c873143abb5400b61..8b4e610b728e819fc6a4bcfd364b5a9ac50c53ba 100644 (file)
@@ -155,12 +155,18 @@ pass to the OPERATION."
   "Return a list of (nil host) tuples allowed to access."
   (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)))))
+      ;; `call-process' does not react on timer under MS Windows.
+      ;; That's why we use `start-process'.
+      (let ((p (start-process
+               tramp-adb-program (current-buffer) tramp-adb-program "devices"))
+           result)
+       (tramp-compat-set-process-query-on-exit-flag p nil)
+       (while (eq 'run (process-status p))
+         (sleep-for 0.1))
+       (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."