Subject: Re: bug#14821: Build broken on 64-bit Cygwin starting with bzr revision 113315

From: Ken Brown <[email-masked]>
Date: Tue, 09 Jul 2013 09:28:03 -0400

On 7/9/2013 8:33 AM, Ken Brown wrote:
> But the point is that setmode shouldn't be used on Cygwin (and wasn't
> prior to revision 113315).
>
> The following patch allows the build to complete, but I don't know if
> it's the right fix:
>
> === modified file 'lib/pipe2.c'
> --- lib/pipe2.c 2013-07-07 18:00:14 +0000
> +++ lib/pipe2.c 2013-07-09 12:20:47 +0000
> @@ -138,7 +138,7 @@
>           goto fail;
>       }
>
> -# if O_BINARY
> +# if O_BINARY && !defined (CYGWIN)
>     if (flags & O_BINARY)
>       {
>         setmode (fd[1], O_BINARY);

On second thought, instead of the negative '!defined (CYGWIN)', the code 
should probably explicitly list the platforms on which setmode *should* 
be used.  This is how it's done in other uses of setmode.

Ken