From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27360 invoked from network); 29 Oct 2006 17:53:01 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.7 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 29 Oct 2006 17:53:01 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 89637 invoked from network); 29 Oct 2006 17:52:48 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 29 Oct 2006 17:52:48 -0000 Received: (qmail 5054 invoked by alias); 29 Oct 2006 17:52:45 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 22919 Received: (qmail 5045 invoked from network); 29 Oct 2006 17:52:45 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 29 Oct 2006 17:52:45 -0000 Received: (qmail 89265 invoked from network); 29 Oct 2006 17:52:45 -0000 Received: from vms046pub.verizon.net (206.46.252.46) by a.mx.sunsite.dk with SMTP; 29 Oct 2006 17:52:42 -0000 Received: from torch.brasslantern.com ([71.116.118.106]) by vms046.mailsrvcs.net (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) with ESMTPA id <0J7W00IWGSBH7MH3@vms046.mailsrvcs.net> for zsh-workers@sunsite.dk; Sun, 29 Oct 2006 11:52:30 -0600 (CST) Received: from torch.brasslantern.com (localhost.localdomain [127.0.0.1]) by torch.brasslantern.com (8.13.1/8.13.1) with ESMTP id k9THqSXP008391; Sun, 29 Oct 2006 09:52:29 -0800 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id k9THqRtX008390; Sun, 29 Oct 2006 09:52:27 -0800 Date: Sun, 29 Oct 2006 09:52:23 -0800 From: Bart Schaefer Subject: Re: gunzip 1.3.5 error reading from stdin on Cygwin In-reply-to: <20a807210610290514k7f17abdfja21c611b45ff468b@mail.gmail.com> To: "Vin Shelton" , cygwin@cygwin.com Cc: zsh-workers@sunsite.dk Message-id: <061029095227.ZM8389@torch.brasslantern.com> MIME-version: 1.0 X-Mailer: OpenZMail Classic (0.9.2 24April2005) Content-type: text/plain; charset=us-ascii References: <20a807210610290514k7f17abdfja21c611b45ff468b@mail.gmail.com> Comments: In reply to "Vin Shelton" "Re: gunzip 1.3.5 error reading from stdin on Cygwin" (Oct 29, 5:14am) On Oct 29, 5:14am, Vin Shelton wrote: } Subject: Re: gunzip 1.3.5 error reading from stdin on Cygwin } } I've narrowed this down a little bit. It only happens under zsh; } under bash, the recipe works without error. In zsh's main.c is this comment: * Cygwin supports the notion of binary or text mode access to files * based on the mount attributes of the filesystem. If a file is on * a binary mounted filesystem, you get exactly what's in the file, CRLF's * and all. If it's on a text mounted filesystem, Cygwin will strip out * the CRs. This presents a problem because zsh code doesn't allow for * CRLF's as line terminators. So, we must force all open files to be * in text mode reguardless of the underlying filesystem attributes. * However, we only want to do this for reading, not writing as we still * want to write files in the mode of the filesystem. To do this, * we have two options: augment all {f}open() calls to have O_TEXT added to * the list of file mode options, or have the Cygwin runtime do it for us. * I choose the latter. :) * * Cygwin's runtime provides pre-execution hooks which allow you to set * various attributes for the process which effect how the process functions. * One of these attributes controls how files are opened. I've set * it up so that all files opened RDONLY will have the O_TEXT option set, * thus forcing line termination manipulation. This seems to solve the * problem (at least the Test suite runs clean :). * * Note: this may not work in later implementations. This will override * all mode options passed into open(). Cygwin (really Windows) doesn't * support all that much in options, so for now this is OK, but later on * it may not, in which case O_TEXT will have to be added to all opens calls * appropriately. The actual code is: static struct __cygwin_perfile pf[] = { {"", O_RDONLY | O_TEXT}, {NULL, 0} }; cygwin_internal (CW_PERFILE, pf); --