summaryrefslogtreecommitdiff
path: root/lisp/net
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2021-09-23 14:29:28 +0200
committerMichael Albinus <michael.albinus@gmx.de>2021-09-23 14:29:28 +0200
commit72f8a9dd08132119a9a5e2b4c3dcb5b5a5e28ad2 (patch)
tree9b83377630428ae3c503ddbde1d4c2007d73c70c /lisp/net
parent23970e27eeee1f33e3e1869a8ef1676b0e48cdc5 (diff)
downloademacs-72f8a9dd08132119a9a5e2b4c3dcb5b5a5e28ad2.tar.gz
Fix Tramp's make-process on macOS
* lisp/net/tramp-sh.el (tramp-get-remote-mknod-or-mkfifo): New defun. (tramp-sh-handle-make-process): Use it. (Bug#50748)
Diffstat (limited to 'lisp/net')
-rw-r--r--lisp/net/tramp-sh.el25
1 files changed, 23 insertions, 2 deletions
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 18599f7c39c..7f1a52fa934 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -2883,10 +2883,14 @@ implementation will be used."
;; Handle error buffer.
(when (bufferp stderr)
+ (unless (tramp-get-remote-mknod-or-mkfifo v)
+ (tramp-error
+ v 'file-error "Stderr buffer `%s' not supported" stderr))
(with-current-buffer stderr
(setq buffer-read-only nil))
;; Create named pipe.
- (tramp-send-command v (format "mknod %s p" tmpstderr))
+ (tramp-send-command
+ v (format (tramp-get-remote-mknod-or-mkfifo v) tmpstderr))
;; Create stderr process.
(make-process
:name (buffer-name stderr)
@@ -2963,7 +2967,7 @@ implementation will be used."
(ignore-errors
(set-process-query-on-exit-flag p (null noquery))
(set-marker (process-mark p) (point)))
- ;; Kill stderr process delete and named pipe.
+ ;; Kill stderr process and delete named pipe.
(when (bufferp stderr)
(add-function
:after (process-sentinel p)
@@ -5796,6 +5800,23 @@ This command is returned only if `delete-by-moving-to-trash' is non-nil."
(tramp-file-local-name tmpfile) (tramp-file-local-name tmpfile)))
(delete-file tmpfile)))))
+(defun tramp-get-remote-mknod-or-mkfifo (vec)
+ "Determine remote `mknod' or `mkfifo' command."
+ (with-tramp-connection-property vec "mknod-or-mkfifo"
+ (tramp-message vec 5 "Finding a suitable `mknod' or `mkfifo' command")
+ (let ((tmpfile (tramp-make-tramp-temp-name vec))
+ command)
+ (prog1
+ (or (and (setq command "mknod %s p")
+ (tramp-send-command-and-check
+ vec (format command (tramp-file-local-name tmpfile)))
+ command)
+ (and (setq command "mkfifo %s")
+ (tramp-send-command-and-check
+ vec (format command (tramp-file-local-name tmpfile)))
+ command))
+ (delete-file tmpfile)))))
+
;; Some predefined connection properties.
(defun tramp-get-inline-compress (vec prop size)
"Return the compress command related to PROP.