From 714611bd0ca66e2674d0aee8034dae355add9f57 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sun, 20 Jun 2021 19:19:31 -0700 Subject: subprocesses: cygwin fixes. * stream.c (fds_subst, fds_swizzle, fds_restore): These functions are used on Cygwin by some functions that are based on spawn, and so must be avaiable. * tests/018/process.tl: Two fixes here. Firstly, the 1>&1 redirection in one of the tests should be 1>&2 on all platforms. That a temporary edit left behind from massaging the tests and the code. Secondly, some weird results are observed on Cygwin. The communication with the child sees an extra carriage return and space sneak in. I'm just codifying this as Cygwin's way of passing the test case; it's likely unfixable at the application level. --- tests/018/process.tl | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'tests/018') diff --git a/tests/018/process.tl b/tests/018/process.tl index b34047b2..1b3780ac 100644 --- a/tests/018/process.tl +++ b/tests/018/process.tl @@ -13,6 +13,12 @@ ^(with-stream (s (open-subprocess nil "r" nil (lambda () ,*forms))) (get-string s))) -(mtest - (fcmd (let ((*stdout* *stdnull*)) (sh "echo foo"))) "" - (fcmd (let ((*stderr* *stdout*)) (sh "echo foo 1>&1"))) "foo\n") +(caseq (os-symbol) + ((:cygwin :cygnal) + (mtest + (fcmd (let ((*stdout* *stdnull*)) (sh "echo foo"))) "" + (fcmd (let ((*stderr* *stdout*)) (sh "echo foo 1>&2"))) "foo \r\n")) + (t + (mtest + (fcmd (let ((*stdout* *stdnull*)) (sh "echo foo"))) "" + (fcmd (let ((*stderr* *stdout*)) (sh "echo foo 1>&2"))) "foo\n"))) -- cgit v1.2.3