Subject: Re: bug#10466: MSYS problem with redirects

From: Peter Rosin <[email-masked]>
Date: Fri, 27 Jan 2012 15:37:50 +0100

Stefano Lattarini skrev 2012-01-27 13:20:
> tags 10466 + patch
> severity 10466 minor
> thanks
> 
> On 01/16/2012 12:40 PM, Peter Rosin wrote:
>> Sorry for the delay.
>>
> Ditto here :-)
> 
>> Stefano Lattarini skrev 2012-01-09 20:32:
>>> On 01/09/2012 12:29 PM, Peter Rosin wrote:
>>>> Hi!
>>>>
>>>> parallel-tests-fd-redirect.test fails on MSYS, and I think
>>>> the cause is that the write (9, ...) simply doesn't work for
>>>> MinGW programs (baz.exe and qux.test.exe).  It works for the
>>>> shell scripts (foo.sh and bar) since /bin/sh is an MSYS
>>>> program and thus is a lot more POSIXy.  But redirecting from
>>>> the MinGW world to the MSYS world in this manner is simply
>>>> not possible, I think.  I think that will only work for
>>>> fd 0,1 and 2 (but I'm not 100% sure).
>>>>
> The attached patch should take care of the issue.  Can you confirm
> this is actually the case, before I push it?

On Cygwin with gcc, both tests PASS. Good.

On MSYS(in MinGW mode) with gcc, ...-exeext SKIPs, because of this:

configure:3327: cc -o conftest.exe -g -O2   conftest.c  >&5
configure:3327: $? = 0
configure:3328: ./conftest.exe 9>&1
configure:3331: $? = 0
configure:3333: (./conftest.exe 9>&1) | grep ^foobar
configure:3336: $? = 1

Good.

On MSYS/cl, ...-exeext SKIPs, because of this:
configure:3327: /c/Cygwin/home/peda/automake-1.11.2b/lib/compile cl -nologo -o conftest.exe    conftest.c  >&5
conftest.c
conftest.c(11) : fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory
configure:3327: $? = 2

Probably not intended, but perhaps a good thing, because unistd.h will not
be available everywhere and lacking it is not should not cause a FAIL in
the Automake test suite.

So, the patch is good. Thanks for fixing!

Cheers,
Peter