summaryrefslogtreecommitdiff
path: root/lisp/net
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2020-05-13 14:11:18 +0200
committerMichael Albinus <michael.albinus@gmx.de>2020-05-13 14:11:18 +0200
commitf8a9edce7339273f9c56d27cc6999a22907638e7 (patch)
tree3962cec949bfb536c452af4325060551cf605921 /lisp/net
parent9ebf51999ce58cccc2a228fd07a18c7b472dd3fd (diff)
downloademacs-f8a9edce7339273f9c56d27cc6999a22907638e7.tar.gz
Fix some oddities, uncovered by Tramp tests
* lisp/net/tramp-gvfs.el (tramp-gvfs-enabled): Prevent crash for older Emacsen. * lisp/net/tramp.el (tramp-process-running-p): Simplify. * test/lisp/net/tramp-tests.el (tramp-test28-process-file): Adapt test. (tramp-test33-environment-variables): Unset "INSIDE_EMACS" initially.
Diffstat (limited to 'lisp/net')
-rw-r--r--lisp/net/tramp-gvfs.el5
-rw-r--r--lisp/net/tramp.el15
2 files changed, 12 insertions, 8 deletions
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el
index f19e510eb67..704d65cd55e 100644
--- a/lisp/net/tramp-gvfs.el
+++ b/lisp/net/tramp-gvfs.el
@@ -125,7 +125,10 @@
(autoload 'zeroconf-init "zeroconf")
(tramp-compat-funcall 'dbus-get-unique-name :system)
(tramp-compat-funcall 'dbus-get-unique-name :session)
- (or (tramp-process-running-p "gvfs-fuse-daemon")
+ (or ;; Until Emacs 25, `process-attributes' could crash Emacs
+ ;; for some processes. Better we don't check.
+ (<= emacs-major-version 25)
+ (tramp-process-running-p "gvfs-fuse-daemon")
(tramp-process-running-p "gvfsd-fuse"))))
"Non-nil when GVFS is available.")
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index c8fdc5d7285..70fb46bb4cb 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -3783,7 +3783,8 @@ support symbolic links."
(defun tramp-handle-start-file-process (name buffer program &rest args)
"Like `start-file-process' for Tramp files.
BUFFER might be a list, in this case STDERR is separated."
- ;; `make-process' knows the `:file-handler' argument since Emacs 27.1 only.
+ ;; `make-process' knows the `:file-handler' argument since Emacs
+ ;; 27.1 only. Therefore, we invoke it via `tramp-file-name-handler'.
(tramp-file-name-handler
'make-process
:name name
@@ -4857,13 +4858,13 @@ verbosity of 6."
"Return t if system process PROCESS-NAME is running for `user-login-name'."
(when (stringp process-name)
(catch 'result
- (dolist (pid (tramp-compat-funcall 'list-system-processes))
- (let ((attributes (process-attributes pid)))
+ (dolist (pid (list-system-processes))
+ (when-let ((attributes (process-attributes pid))
+ (comm (cdr (assoc 'comm attributes))))
(and (string-equal (cdr (assoc 'user attributes)) (user-login-name))
- (when-let ((comm (cdr (assoc 'comm attributes))))
- ;; The returned command name could be truncated to 15
- ;; characters. Therefore, we cannot check for `string-equal'.
- (string-prefix-p comm process-name))
+ ;; The returned command name could be truncated to 15
+ ;; characters. Therefore, we cannot check for `string-equal'.
+ (string-prefix-p comm process-name)
(throw 'result t)))))))
(defun tramp-read-passwd (proc &optional prompt)