Ensure local `default-directory' in Tramp when needed
* lisp/net/tramp.el (tramp-process-running-p): Ensure local `default-directory' when calling `list-system-processes' and `process-attributes'.
This commit is contained in:
parent
4f27588a16
commit
ff997ad786
1 changed files with 9 additions and 8 deletions
|
@ -5666,14 +5666,15 @@ verbosity of 6."
|
||||||
"Return t if system process PROCESS-NAME is running for `user-login-name'."
|
"Return t if system process PROCESS-NAME is running for `user-login-name'."
|
||||||
(when (stringp process-name)
|
(when (stringp process-name)
|
||||||
(catch 'result
|
(catch 'result
|
||||||
(dolist (pid (list-system-processes))
|
(let ((default-directory temporary-file-directory))
|
||||||
(when-let ((attributes (process-attributes pid))
|
(dolist (pid (list-system-processes))
|
||||||
(comm (cdr (assoc 'comm attributes))))
|
(when-let ((attributes (process-attributes pid))
|
||||||
(and (string-equal (cdr (assoc 'user attributes)) (user-login-name))
|
(comm (cdr (assoc 'comm attributes))))
|
||||||
;; The returned command name could be truncated to 15
|
(and (string-equal (cdr (assoc 'user attributes)) (user-login-name))
|
||||||
;; characters. Therefore, we cannot check for `string-equal'.
|
;; The returned command name could be truncated to 15
|
||||||
(string-prefix-p comm process-name)
|
;; characters. Therefore, we cannot check for `string-equal'.
|
||||||
(throw 'result t)))))))
|
(string-prefix-p comm process-name)
|
||||||
|
(throw 'result t))))))))
|
||||||
|
|
||||||
;; When calling "emacs -Q", `auth-source-search' won't be called. If
|
;; When calling "emacs -Q", `auth-source-search' won't be called. If
|
||||||
;; you want to debug exactly this case, call "emacs -Q --eval '(setq
|
;; you want to debug exactly this case, call "emacs -Q --eval '(setq
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue