git: 9front

Download patch

ref: b01ae1602688e626014ff8b439e740062a2c8702
parent: bcc5530dab33d4603c421ae31be64d2ff3be7ec5
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Mon Dec 19 14:05:35 EST 2016

rcpu: avoid filedescriptor conflict with <{} (thanks mycroftiv)

the rcpu client dup's fd 0,1,2 to fd 10,11,12 which
can accidentally override the pipe file descriptor
allocated by the <{} operator. to avoid this problem,
we generate the remote script as an /env file in a
separate step now.

--- a/rc/bin/rcpu
+++ b/rc/bin/rcpu
@@ -80,4 +80,9 @@
 	}
 }
 
-exec $connect $host <{dir=`{pwd} pvar dir cmd; builtin whatis server; echo server} client <[10=0] >[11=1] >[12=2]
+>/env/rscript {
+	dir=`{pwd} pvar dir cmd
+	builtin whatis server
+	echo server
+}
+exec $connect $host /env/rscript client <[10=0] >[11=1] >[12=2]
--