delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/03/12/18:02:33

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE
X-Spam-Check-By: sourceware.org
X-Mail-Handler: MailHop Outbound by DynDNS
X-Report-Abuse-To: abuse AT dyndns DOT com (see http://www.dyndns.com/services/mailhop/outbound_abuse.html for abuse reporting information)
X-MHO-User: U2FsdGVkX184W80n9DpxSinhmzSjWUcD
Date: Mon, 12 Mar 2012 18:02:04 -0400
From: Christopher Faylor <cgf-use-the-mailinglist-please AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Can't reliably redirect standard output from C# program in recent Cygwin
Message-ID: <20120312220204.GA29921@ednor.casa.cgf.cx>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <004e01ccfd70$c69af3f0$53d0dbd0$@motionview3d.com> <005c01ccfd79$6341f980$29c5ec80$@motionview3d.com> <loom DOT 20120309T021648-138 AT post DOT gmane DOT org> <007201ccfe25$130065e0$390131a0$@motionview3d.com> <20120309195247 DOT GB18960 AT calimero DOT vinschen DOT de> <20120311013339 DOT GA32518 AT ednor DOT casa DOT cgf DOT cx> <00b701cd0059$25c26a80$71473f80$@motionview3d.com> <20120312141929 DOT GE2382 AT calimero DOT vinschen DOT de> <00cf01cd0075$8430b290$8c9217b0$@motionview3d.com>
MIME-Version: 1.0
In-Reply-To: <00cf01cd0075$8430b290$8c9217b0$@motionview3d.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Mon, Mar 12, 2012 at 05:28:17PM -0000, James Johnston wrote:
>Well, good call.  I shouldn't have jumped to conclusions.  Both my C++
>and C# examples still fail:

Not really a call.  It was obviously different failure.  The previous
fix wasn't even pipe related.

But, regardless, Corinna (who has more time these days to look into
this type of thing) found a damning piece of MSDN documentation which
indicates that a write of zero bytes to a pipe will cause a read of
zero bytes on the other end of the pipe.  So, a program which assumes
that a zero byte read means EOF, like most Linux programs, will stop
processing when it sees the zero bytes from ReadFile.

Corinna sent me a patch to fix the problem which I've mildly tweaked and
installed.  It's in the latest snapshot.

cgf

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019