X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 	tests=BAYES_00,KAM_MX,SPF_PASS
X-Spam-Check-By: sourceware.org
Date: Sun, 18 Jan 2009 23:19:40 +0100
From: Ed Schouten <ed@80386.nl>
To: Sjors Gielen <mailinglist@dazjorz.com>
Cc: "Yaakov (Cygwin/X)" <yselkowitz@users.sourceforge.net>,
   dave.korn.cygwin@googlemail.com, cygwin@cygwin.com
Subject: Re: GNU coreutils does not work on Cygwin because of freopen() ?
Message-ID: <20090118221940.GZ1247@hoeg.nl>
References: <49738867.702@dazjorz.com> <49739D07.7020507@cygwin.com> <49739E38.5080305@dazjorz.com> <4973A2B1.9060601@users.sourceforge.net> <4973A927.1010003@dazjorz.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1; 	protocol="application/pgp-signature"; boundary="6JAe/4X0qssghT2u"
Content-Disposition: inline
In-Reply-To: <4973A927.1010003@dazjorz.com>
User-Agent: Mutt/1.5.18 (2008-05-17)
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

--6JAe/4X0qssghT2u
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hello all,

* Sjors Gielen <mailinglist@dazjorz.com> wrote:
> Yaakov (Cygwin/X) wrote:
>> Sjors Gielen wrote:
>>> Did you try with Cygwin coreutils or GNU coreutils? :)
>>
>> Cygwin's coreutils *is* GNU coreutils, with some patches which you will
>> find necessary.
>>
> [snip]
> Dave Korn wrote:
> >   However, you may have to recreate all the cygwin-specific patches
> > that the
> > cygwin bash maintainer hasn't managed to send upstream yet...
> [snip]
> > ?? Are you using an old version??  It should be fixed by now.
> >
> > http://www.mail-archive.com/bug-coreutils@gnu.org/msg10188.html
>
> Oooh. Can I get a list of patches the Cygwin project has already applied=
=20=20
> to packages? :)
> So this bug was fixed in Cygwin's version of GNU coreutils, but not in=20=
=20
> Debian's version of GNU coreutils. Has a patch for that been sent=20=20
> upstream? I took GNU coreutils from Debian sid, which should be almost=20=
=20
> as up to date as it gets...

But that's not a proper fix anyway. cat can't just decide to reopen the
file descriptor of the standard output. That even breaks the first
sentence of POSIX:

	The cat utility shall read files in sequence and shall write
	their contents to the standard output in the same sequence.

If it says "the standard output" doesn't mean you can reopen the output
descriptor. This means you end up with two different file descriptors.
They can point to the same file, but they are not the same file
descriptor.

They fixed it by using SET_BINARY(), but not on Cygwin, because I assume
SET_BINARY() is a Windows-thing, not Cygwin.

I can't really understand why Cygwin just doesn't force O_BINARY to be
set. File descriptors on UNIX are supposed to display raw file contents.
There shouldn't be any (newline) processing. It makes no sense to
cripple Cygwin only because Notepad doesn't support newlines without the
carriage return.

--=20
 Ed Schouten <ed@80386.nl>
 WWW: http://80386.nl/

--6JAe/4X0qssghT2u
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (FreeBSD)

iEYEARECAAYFAklzqvwACgkQ52SDGA2eCwWayACeL6pNXsMlqm/V59xG8/tfRHsq
v9cAn2b/+4p3CxaIpR8wQo7b+zhKh6Ve
=qhNa
-----END PGP SIGNATURE-----

--6JAe/4X0qssghT2u--
