aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2019-02-23 11:56:37 +0100
committerMichael Albinus2019-02-23 11:56:37 +0100
commit5f640bfdf84753322763be23ebaa8ded92dc1c5d (patch)
tree3fbed9e24659ace036c4e0d3e5f154b1c3af5b94
parentc7e4bc974b7ec3d6fdae105df05fc19a2cf9fdbd (diff)
downloademacs-5f640bfdf84753322763be23ebaa8ded92dc1c5d.tar.gz
emacs-5f640bfdf84753322763be23ebaa8ded92dc1c5d.zip
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.
-rw-r--r--lisp/net/tramp-cache.el11
-rw-r--r--lisp/net/tramp-sh.el12
-rw-r--r--lisp/net/tramp-smb.el5
3 files changed, 19 insertions, 9 deletions
diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el
index 064b209ec2f..0fb9bea14bc 100644
--- a/lisp/net/tramp-cache.el
+++ b/lisp/net/tramp-cache.el
@@ -128,9 +128,14 @@ Returns DEFAULT if not set."
128 (and (consp value) 128 (and (consp value)
129 (or (null remote-file-name-inhibit-cache) 129 (or (null remote-file-name-inhibit-cache)
130 (and (integerp remote-file-name-inhibit-cache) 130 (and (integerp remote-file-name-inhibit-cache)
131 (time-less-p nil 131 (time-less-p
132 (time-add (car value) 132 ;; `current-time' can be nil once we get rid of Emacs 24.
133 remote-file-name-inhibit-cache))) 133 (current-time)
134 (time-add
135 (car value)
136 ;; `seconds-to-time' can be removed once we get
137 ;; rid of Emacs 24.
138 (seconds-to-time remote-file-name-inhibit-cache))))
134 (and (consp remote-file-name-inhibit-cache) 139 (and (consp remote-file-name-inhibit-cache)
135 (time-less-p 140 (time-less-p
136 remote-file-name-inhibit-cache (car value))))) 141 remote-file-name-inhibit-cache (car value)))))
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 91ff1532933..2d02961db5e 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -4785,8 +4785,11 @@ connection if a previous connection has died for some reason."
4785 (not (tramp-file-name-equal-p 4785 (not (tramp-file-name-equal-p
4786 vec (car tramp-current-connection))) 4786 vec (car tramp-current-connection)))
4787 (time-less-p 4787 (time-less-p
4788 (or tramp-connection-min-time-diff 0) 4788 ;; `current-time' can be removed once we get rid of Emacs 24.
4789 (time-since (cdr tramp-current-connection)))) 4789 (time-since (or (cdr tramp-current-connection) (current-time)))
4790 ;; `seconds-to-time' can be removed once we get rid
4791 ;; of Emacs 24.
4792 (seconds-to-time (or tramp-connection-min-time-diff 0))))
4790 (throw 'suppress 'suppress)) 4793 (throw 'suppress 'suppress))
4791 4794
4792 ;; If too much time has passed since last command was sent, look 4795 ;; 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 ;; try to send a command from time to time, then look again 4800 ;; try to send a command from time to time, then look again
4798 ;; whether the process is really alive. 4801 ;; whether the process is really alive.
4799 (condition-case nil 4802 (condition-case nil
4800 (when (and (time-less-p 60 4803 ;; `seconds-to-time' can be removed once we get rid of Emacs 24.
4804 (when (and (time-less-p (seconds-to-time 60)
4801 (time-since 4805 (time-since
4802 (tramp-get-connection-property 4806 (tramp-get-connection-property
4803 p "last-cmd-time" 0))) 4807 p "last-cmd-time" (seconds-to-time 0))))
4804 (process-live-p p)) 4808 (process-live-p p))
4805 (tramp-send-command vec "echo are you awake" t t) 4809 (tramp-send-command vec "echo are you awake" t t)
4806 (unless (and (process-live-p p) 4810 (unless (and (process-live-p p)
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el
index 31470b29790..eda30812ebc 100644
--- a/lisp/net/tramp-smb.el
+++ b/lisp/net/tramp-smb.el
@@ -1900,10 +1900,11 @@ If ARGUMENT is non-nil, use it as argument for
1900 ;; connection timeout. 1900 ;; connection timeout.
1901 (with-current-buffer buf 1901 (with-current-buffer buf
1902 (goto-char (point-min)) 1902 (goto-char (point-min))
1903 (when (and (time-less-p 60 1903 ;; `seconds-to-time' can be removed once we get rid of Emacs 24.
1904 (when (and (time-less-p (seconds-to-time 60)
1904 (time-since 1905 (time-since
1905 (tramp-get-connection-property 1906 (tramp-get-connection-property
1906 p "last-cmd-time" 0))) 1907 p "last-cmd-time" (seconds-to-time 0))))
1907 (process-live-p p) 1908 (process-live-p p)
1908 (re-search-forward tramp-smb-errors nil t)) 1909 (re-search-forward tramp-smb-errors nil t))
1909 (delete-process p) 1910 (delete-process p)