1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 18:40:39 -08:00

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.
This commit is contained in:
Michael Albinus 2020-06-07 16:56:59 +02:00
parent 9fc935f122
commit 54e840a8b4
3 changed files with 13 additions and 13 deletions

View file

@ -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

View file

@ -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.

View file

@ -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)