]> git.eshelyaron.com Git - emacs.git/commitdiff
Tramp code cleanup
authorMichael Albinus <michael.albinus@gmx.de>
Sun, 7 Jun 2020 14:56:59 +0000 (16:56 +0200)
committerMichael Albinus <michael.albinus@gmx.de>
Sun, 7 Jun 2020 14:56:59 +0000 (16:56 +0200)
* 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
lisp/net/tramp-cmds.el
lisp/net/tramp-sh.el

index 02400f9deb51554c3913a8bfc42d8e2720840466..970e2eea0ac548e031dcebe33bdd7cd19e2b9d3d 100644 (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
index 1742da863016de245f7f80c62153707f1cf8eb78..2805f6648ce9106d7947648824e14ed5376877e6 100644 (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.
index 523663cafbd573212b3e1fdb938fbc371930785d..a3ce436e42a164f4dcd917911d87d4abbc84252f 100644 (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)