summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/net/tramp.el35
2 files changed, 25 insertions, 15 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index b09604eb0bb..839be79a88b 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2007-09-27 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp.el (tramp-maybe-open-connection): Make test for alive
+ connection more robust.
+
2007-09-26 Juanma Barranquero <lekktu@gmail.com>
* emacs-lisp/eldoc.el (eldoc-function-argstring-format):
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index db6739a9e9f..3d1d6786fb4 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -2422,7 +2422,7 @@ target of the symlink differ."
res-size
;; 8. File modes, as a string of ten letters or dashes as in ls -l.
res-filemodes
- ;; 9. t iff file's gid would change if file were deleted and
+ ;; 9. t if file's gid would change if file were deleted and
;; recreated. Will be set in `tramp-convert-file-attributes'
t
;; 10. inode number.
@@ -5688,9 +5688,7 @@ process to set up. VEC specifies the connection."
(tramp-send-command-internal vec "set +o vi +o emacs")
(tramp-message vec 5 "Setting shell prompt")
;; Douglas Gray Stephens <DGrayStephens@slb.com> says that we must
- ;; use "\n" here, not tramp-rsh-end-of-line. We also manually frob
- ;; the last time we sent a command, to avoid `tramp-send-command' to
- ;; send "echo are you awake".
+ ;; use "\n" here, not tramp-rsh-end-of-line.
(tramp-send-command
vec
(format "PROMPT_COMMAND=''; PS1='%s%s%s'; PS2=''; PS3=''"
@@ -6044,16 +6042,23 @@ connection if a previous connection has died for some reason."
;; tries to send some data to the remote end. So that's why we
;; try to send a command from time to time, then look again
;; whether the process is really alive.
- (when (and (> (tramp-time-diff
- (current-time)
- (tramp-get-connection-property p "last-cmd-time" '(0 0 0)))
- 60)
- p (processp p) (memq (process-status p) '(run open)))
- (tramp-send-command vec "echo are you awake" t t)
- (unless (and (memq (process-status p) '(run open))
- (tramp-wait-for-output p 10))
- (delete-process p)
- (setq p nil)))
+ (condition-case nil
+ (when (and (> (tramp-time-diff
+ (current-time)
+ (tramp-get-connection-property
+ p "last-cmd-time" '(0 0 0)))
+ 60)
+ p (processp p) (memq (process-status p) '(run open)))
+ (tramp-send-command vec "echo are you awake" t t)
+ (unless (and (memq (process-status p) '(run open))
+ (tramp-wait-for-output p 10))
+ ;; The error will be catched locally.
+ (tramp-error vec 'file-error "Awake did fail")))
+ (file-error
+ (tramp-flush-connection-property vec nil)
+ (tramp-flush-connection-property p nil)
+ (delete-process p)
+ (setq p nil)))
;; New connection must be opened.
(unless (and p (processp p) (memq (process-status p) '(run open)))
@@ -6571,7 +6576,7 @@ Not actually used. Use `(format \"%o\" i)' instead?"
(string-to-number (match-string 2 host)))))
(defun tramp-tramp-file-p (name)
- "Return t iff NAME is a tramp file."
+ "Return t if NAME is a tramp file."
(save-match-data
(string-match tramp-file-name-regexp name)))