]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix stale cache problem in Tramp
authorMichael Albinus <michael.albinus@gmx.de>
Mon, 15 Aug 2016 10:29:20 +0000 (12:29 +0200)
committerMichael Albinus <michael.albinus@gmx.de>
Mon, 15 Aug 2016 10:29:20 +0000 (12:29 +0200)
* lisp/net/tramp-cache.el (tramp-get-connection-property):
Check, that a process as key is still running.  (Bug#22478)

lisp/net/tramp-cache.el

index 07176be6e4e55a7e365d3d16f621835dfd10f29f..76b49a09e3ac9526d33504c53ddc567e50f53d1b 100644 (file)
@@ -237,9 +237,14 @@ connection, returns DEFAULT."
     (aset key 3 nil)
     (aset key 4 nil))
   (let* ((hash (tramp-get-hash-table key))
-        (value (if (hash-table-p hash)
-                   (gethash property hash default)
-                 default)))
+        (value
+         ;; If the key is an auxiliary process object, check whether
+         ;; the process is still alive.
+         (if (and (processp key) (not (memq (process-status key) '(run open))))
+             default
+           (if (hash-table-p hash)
+               (gethash property hash default)
+             default))))
     (tramp-message key 7 "%s %s" property value)
     value))