]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/net/tramp-sh.el (tramp-get-remote-pipe-buf): Make it more robust.
authorMichael Albinus <michael.albinus@gmx.de>
Sun, 5 Jan 2025 14:24:21 +0000 (15:24 +0100)
committerEshel Yaron <me@eshelyaron.com>
Wed, 8 Jan 2025 08:33:51 +0000 (09:33 +0100)
(cherry picked from commit 672a5f2b82c3c57b753902f2bdf5c970f3fc63a9)

lisp/net/tramp-sh.el

index f3daf3278f059705e06fddc49252038caa3b8acd..323114447567d872d2a16fa73ad706ea5874393f 100644 (file)
@@ -5640,6 +5640,7 @@ Nonexistent directories are removed from spec."
 ;;   - 8 KiB on HP-UX, Plan9.
 ;;   - 10 KiB on IRIX.
 ;;   - 32 KiB on AIX, Minix.
+;;   - `undefined' on QNX.
 ;; [1] https://pubs.opengroup.org/onlinepubs/9699919799/functions/write.html
 ;; [2] https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html
 ;; See Bug#65324.
@@ -5647,11 +5648,13 @@ Nonexistent directories are removed from spec."
 (defun tramp-get-remote-pipe-buf (vec)
   "Return PIPE_BUF config from the remote side."
   (with-tramp-connection-property vec "pipe-buf"
-    (tramp-send-command-and-read
-     vec
-     (format "getconf PIPE_BUF / 2>%s || echo 4096"
-             (tramp-get-remote-null-device vec))
-     'noerror)))
+    (if-let* ((result
+              (tramp-send-command-and-read
+               vec (format "getconf PIPE_BUF / 2>%s"
+                           (tramp-get-remote-null-device vec))
+               'noerror))
+             ((natnump result)))
+       result 4096)))
 
 (defun tramp-get-remote-locale (vec)
   "Determine remote locale, supporting UTF8 if possible."