Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Date: Fri, 9 Nov 2001 01:14:57 +0100 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: 1.3.4: read on pipe setting errno=ECHILD Message-ID: <20011109011457.E31424@cygbert.vinschen.de> Mail-Followup-To: cygwin AT cygwin DOT com References: <200111090005 DOT QAA15761 AT gloworm DOT Stanford DOT EDU> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200111090005.QAA15761@gloworm.Stanford.EDU>; from yergeau@gloworm.Stanford.EDU on Thu, Nov 08, 2001 at 04:05:17PM -0800 On Thu, Nov 08, 2001 at 04:05:17PM -0800, Dan Yergeau wrote: > > When I upgraded from 1.3.3 to 1.3.4 on W2K, I noticed tcsh's > backquote substitution getting a little "random" (i.e. sometimes it > would work, and sometimes an empty string would be substituted). I > traced this randomness to the following fragment in tcsh's > sh.glob.c:backeval() routine: > > do > icnt = read(pvec[0], tibuf, BUFSIZE); > while (icnt == -1 && errno == EINTR); > if (icnt <= 0) { > c = -1; > break; > } > > The "break" is out of a "gather characters from child process" loop, > so the output of the child process is *sometimes* discarded. FWICT, > 1.3.3 would always set errno=EINTR (I'm assuming that this is > because the parent process receives a SIGCHILD before all of the > data is available to the read). > > The above problem could be fixed by changing the "errno == EINTR" to > "(errno == EINTR || errno == ECHILD)", but I can't find any > documentation that a POSIX read() is permitted to set errno to > ECHILD, so I don't think that this change is really justifiable. I > just may not have access to the correct documentation on what errno > values may be set to by read, so I'll defer judgment to the experts. Thanks for the report. That problem has probably the same reason as the problem with tcsh exiting on changing the window size, reported today in the thread "1.3.4: rxvt causes tcsh to exit when" resized (nt)". That's fixed in the current developers sources. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Developer mailto:cygwin AT cygwin DOT com Red Hat, Inc. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/