diff options
| author | Michael Albinus | 2012-12-22 14:44:06 +0100 |
|---|---|---|
| committer | Michael Albinus | 2012-12-22 14:44:06 +0100 |
| commit | cdb075396213de91d318dbb6739d1885453a910c (patch) | |
| tree | 09f2c74aa3b4e5c7bd2dd26bed804cec3edbb66e | |
| parent | b2faf49cd91a9270a5532d1be7b1b6f438c56fcc (diff) | |
| download | emacs-cdb075396213de91d318dbb6739d1885453a910c.tar.gz emacs-cdb075396213de91d318dbb6739d1885453a910c.zip | |
* net/tramp-adb.el (tramp-adb-maybe-open-connection): Check
properties of remote device. Restart connection, if there is a
change.
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/net/tramp-adb.el | 26 |
2 files changed, 31 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5e26ee1fca1..c256c7f8179 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2012-12-22 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * net/tramp-adb.el (tramp-adb-maybe-open-connection): Check | ||
| 4 | properties of remote device. Restart connection, if there is a | ||
| 5 | change. | ||
| 6 | |||
| 1 | 2012-12-21 Chong Yidong <cyd@gnu.org> | 7 | 2012-12-21 Chong Yidong <cyd@gnu.org> |
| 2 | 8 | ||
| 3 | * sort.el (sort-subr): Doc fix (Bug#13056). | 9 | * sort.el (sort-subr): Doc fix (Bug#13056). |
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index 261c65ffdae..b500b1bba61 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el | |||
| @@ -982,7 +982,31 @@ connection if a previous connection has died for some reason." | |||
| 982 | (tramp-adb-wait-for-output p) | 982 | (tramp-adb-wait-for-output p) |
| 983 | (unless (eq 'run (process-status p)) | 983 | (unless (eq 'run (process-status p)) |
| 984 | (tramp-error vec 'file-error "Terminated!")) | 984 | (tramp-error vec 'file-error "Terminated!")) |
| 985 | (set-process-query-on-exit-flag p nil))))))) | 985 | (set-process-query-on-exit-flag p nil) |
| 986 | |||
| 987 | ;; Check whether the properties have been changed. If | ||
| 988 | ;; yes, this is a strong indication that we must expire all | ||
| 989 | ;; connection properties. We start again. | ||
| 990 | (tramp-message vec 5 "Checking system information") | ||
| 991 | (tramp-adb-send-command | ||
| 992 | vec "echo \\\"`getprop ro.product.model` `getprop ro.product.version` `getprop ro.build.version.release`\\\"") | ||
| 993 | (let ((old-getprop | ||
| 994 | (tramp-get-connection-property vec "getprop" nil)) | ||
| 995 | (new-getprop | ||
| 996 | (tramp-set-connection-property | ||
| 997 | vec "getprop" | ||
| 998 | (with-current-buffer (tramp-get-connection-buffer vec) | ||
| 999 | ;; Read the expression. | ||
| 1000 | (goto-char (point-min)) | ||
| 1001 | (read (current-buffer)))))) | ||
| 1002 | (when (and (stringp old-getprop) | ||
| 1003 | (not (string-equal old-getprop new-getprop))) | ||
| 1004 | (tramp-cleanup vec) | ||
| 1005 | (tramp-message | ||
| 1006 | vec 3 | ||
| 1007 | "Connection reset, because remote host changed from `%s' to `%s'" | ||
| 1008 | old-getprop new-getprop) | ||
| 1009 | (tramp-adb-maybe-open-connection vec))))))))) | ||
| 986 | 1010 | ||
| 987 | (provide 'tramp-adb) | 1011 | (provide 'tramp-adb) |
| 988 | ;;; tramp-adb.el ends here | 1012 | ;;; tramp-adb.el ends here |