From 3080fb5f28e0337b5859f4d6eb19bda9207a65fa Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 17 Feb 2020 12:11:15 -0800 Subject: cygwin: use spawnvp for run and sh. We revive the dead _wspawnvp code that was used on MinGW, a platform that has not been supported for years, adapting it for Cygwin. * configure: Correct the _wspawnlp test; it should have been testing for _wspawnvp function, which is what is is actually used by the matching code. Moreover, the broken test was calling _wspawnlp with _wspawnvp style arguments. Anyway, this is moot because we will never detect this function in the foreseeable future. More importantly, adding a test for spawnvp, which exists on Cygwin. * stream.c: Include the header if HAVE_WSPAWN or HAVE_SPAWN. This was missing before; how did the _wspawnvp call ever compile? (w_spawnvp): New static function. (run): spawn version now calls either _wspawwnvp or w_spawnvp if that is not available. We test for HAVE_WSPAWN or HAVE_SPAWN first, before HAVE_FORK_STUFF, so that we use the spawn function preferentially. On Cygwin, we have the fork stuff. --- configure | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'configure') diff --git a/configure b/configure index 4198718d..18390a21 100755 --- a/configure +++ b/configure @@ -2506,7 +2506,7 @@ else printf "no\n" fi -printf "Checking for _wspawnlp ... " +printf "Checking for _wspawnvp ... " cat > conftest.c < conftest.c < conftest.c < + +int main(int argc, char **argv) +{ + int r = spawnvp(_P_WAIT, "foo", argv); + return 0; +} +! +if conftest ; then + printf "yes\n" + printf "#define HAVE_SPAWN 1\n" >> config.h +else + printf "no\n" +fi + printf "Checking for chsize ... " cat > conftest.c < -- cgit v1.2.3