This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: 1.3.4: read on pipe setting errno=ECHILD


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@cygwin.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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]