[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 54e840a 1/2: Tramp code cleanup
From: |
Michael Albinus |
Subject: |
master 54e840a 1/2: Tramp code cleanup |
Date: |
Sun, 7 Jun 2020 10:57:44 -0400 (EDT) |
branch: master
commit 54e840a8b44712eff63929c01a916531051c3e0b
Author: Michael Albinus <michael.albinus@gmx.de>
Commit: Michael Albinus <michael.albinus@gmx.de>
Tramp code cleanup
* lisp/net/tramp-cache.el (tramp-get-connection-property): Cleanup.
* lisp/net/tramp-cmds.el (tramp-cleanup-all-connections): Delete also
connection processes.
* lisp/net/tramp-sh.el (tramp-set-remote-path): Cache 4096 even if
PIPE_BUF doesn't exist.
---
lisp/net/tramp-cache.el | 16 ++++++++--------
lisp/net/tramp-cmds.el | 3 ++-
lisp/net/tramp-sh.el | 7 +++----
3 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el
index 02400f9..970e2ee 100644
--- a/lisp/net/tramp-cache.el
+++ b/lisp/net/tramp-cache.el
@@ -142,7 +142,7 @@ Return DEFAULT if not set."
(cached (and (hash-table-p hash) (gethash property hash)))
(cached-at (and (consp cached) (format-time-string "%T" (car cached))))
(value default)
- use-cache)
+ cache-used)
(when ;; We take the value only if there is any, and
;; `remote-file-name-inhibit-cache' indicates that it is
@@ -157,11 +157,11 @@ Return DEFAULT if not set."
(time-less-p
remote-file-name-inhibit-cache (car cached)))))
(setq value (cdr cached)
- use-cache t))
+ cache-used t))
- (tramp-message key 8 "%s %s %s; inhibit: %s; cache used: %s; cached at: %s"
- file property value
- remote-file-name-inhibit-cache use-cache cached-at)
+ (tramp-message
+ key 8 "%s %s %s; inhibit: %s; cache used: %s; cached at: %s"
+ file property value remote-file-name-inhibit-cache cache-used cached-at)
(when (>= tramp-verbose 10)
(let* ((var (intern (concat "tramp-cache-get-count-" property)))
(val (or (numberp (bound-and-true-p var))
@@ -320,15 +320,15 @@ the connection, return DEFAULT."
(gethash property hash tramp-cache-undefined)
tramp-cache-undefined))
(value default)
- use-cache)
+ cache-used)
(when (and (not (eq cached tramp-cache-undefined))
;; If the key is an auxiliary process object, check
;; whether the process is still alive.
(not (and (processp key) (not (process-live-p key)))))
(setq value cached
- use-cache t))
- (tramp-message key 7 "%s %s; cache used: %s" property value use-cache)
+ cache-used t))
+ (tramp-message key 7 "%s %s; cache used: %s" property value cache-used)
value))
;;;###tramp-autoload
diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el
index 1742da8..2805f66 100644
--- a/lisp/net/tramp-cmds.el
+++ b/lisp/net/tramp-cmds.el
@@ -184,8 +184,9 @@ This includes password cache, file cache, connection cache,
buffers."
;; Cancel timers.
(cancel-function-timers 'tramp-timeout-session)
- ;; Remove buffers.
+ ;; Remove processes and buffers.
(dolist (name (tramp-list-tramp-buffers))
+ (when (processp (get-buffer-process name)) (delete-process name))
(when (bufferp (get-buffer name)) (kill-buffer name)))
;; The end.
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 523663c..a3ce436 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -4049,10 +4049,9 @@ variable PATH."
(format
"PATH=%s; export PATH" (string-join (tramp-get-remote-path vec) ":")))
(pipe-buf
- (or (with-tramp-connection-property vec "pipe-buf"
- (tramp-send-command-and-read
- vec "getconf PIPE_BUF / 2>/dev/null || echo nil" 'noerror))
- 4096))
+ (with-tramp-connection-property vec "pipe-buf"
+ (tramp-send-command-and-read
+ vec "getconf PIPE_BUF / 2>/dev/null || echo 4096" 'noerror)))
tmpfile)
(tramp-message vec 5 "Setting $PATH environment variable")
(if (< (length command) pipe-buf)