Commit 5f640bfd authored by Michael Albinus's avatar Michael Albinus

Make last Tramp change backward compatible to Emacs 24

* lisp/net/tramp-cache.el (tramp-get-file-property):
* lisp/net/tramp-sh.el (tramp-maybe-open-connection):
* lisp/net/tramp-smb.el (tramp-smb-maybe-open-connection):
Make them backward compatible to Emacs 24.
parent c7e4bc97
Pipeline #841 passed with stage
in 55 minutes and 59 seconds
...@@ -128,9 +128,14 @@ Returns DEFAULT if not set." ...@@ -128,9 +128,14 @@ Returns DEFAULT if not set."
(and (consp value) (and (consp value)
(or (null remote-file-name-inhibit-cache) (or (null remote-file-name-inhibit-cache)
(and (integerp remote-file-name-inhibit-cache) (and (integerp remote-file-name-inhibit-cache)
(time-less-p nil (time-less-p
(time-add (car value) ;; `current-time' can be nil once we get rid of Emacs 24.
remote-file-name-inhibit-cache))) (current-time)
(time-add
(car value)
;; `seconds-to-time' can be removed once we get
;; rid of Emacs 24.
(seconds-to-time remote-file-name-inhibit-cache))))
(and (consp remote-file-name-inhibit-cache) (and (consp remote-file-name-inhibit-cache)
(time-less-p (time-less-p
remote-file-name-inhibit-cache (car value))))) remote-file-name-inhibit-cache (car value)))))
......
...@@ -4785,8 +4785,11 @@ connection if a previous connection has died for some reason." ...@@ -4785,8 +4785,11 @@ connection if a previous connection has died for some reason."
(not (tramp-file-name-equal-p (not (tramp-file-name-equal-p
vec (car tramp-current-connection))) vec (car tramp-current-connection)))
(time-less-p (time-less-p
(or tramp-connection-min-time-diff 0) ;; `current-time' can be removed once we get rid of Emacs 24.
(time-since (cdr tramp-current-connection)))) (time-since (or (cdr tramp-current-connection) (current-time)))
;; `seconds-to-time' can be removed once we get rid
;; of Emacs 24.
(seconds-to-time (or tramp-connection-min-time-diff 0))))
(throw 'suppress 'suppress)) (throw 'suppress 'suppress))
;; If too much time has passed since last command was sent, look ;; If too much time has passed since last command was sent, look
...@@ -4797,10 +4800,11 @@ connection if a previous connection has died for some reason." ...@@ -4797,10 +4800,11 @@ connection if a previous connection has died for some reason."
;; try to send a command from time to time, then look again ;; try to send a command from time to time, then look again
;; whether the process is really alive. ;; whether the process is really alive.
(condition-case nil (condition-case nil
(when (and (time-less-p 60 ;; `seconds-to-time' can be removed once we get rid of Emacs 24.
(when (and (time-less-p (seconds-to-time 60)
(time-since (time-since
(tramp-get-connection-property (tramp-get-connection-property
p "last-cmd-time" 0))) p "last-cmd-time" (seconds-to-time 0))))
(process-live-p p)) (process-live-p p))
(tramp-send-command vec "echo are you awake" t t) (tramp-send-command vec "echo are you awake" t t)
(unless (and (process-live-p p) (unless (and (process-live-p p)
......
...@@ -1900,10 +1900,11 @@ If ARGUMENT is non-nil, use it as argument for ...@@ -1900,10 +1900,11 @@ If ARGUMENT is non-nil, use it as argument for
;; connection timeout. ;; connection timeout.
(with-current-buffer buf (with-current-buffer buf
(goto-char (point-min)) (goto-char (point-min))
(when (and (time-less-p 60 ;; `seconds-to-time' can be removed once we get rid of Emacs 24.
(when (and (time-less-p (seconds-to-time 60)
(time-since (time-since
(tramp-get-connection-property (tramp-get-connection-property
p "last-cmd-time" 0))) p "last-cmd-time" (seconds-to-time 0))))
(process-live-p p) (process-live-p p)
(re-search-forward tramp-smb-errors nil t)) (re-search-forward tramp-smb-errors nil t))
(delete-process p) (delete-process p)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment