Error set on EOF

Nick Burrett nick at dsvr.net
Sat Mar 30 02:11:52 PST 2002


Alex Waugh <ajw498 at ecs.soton.ac.uk> writes:

> On Sun, 24 Feb 2002, Alex Waugh wrote:
> 
> > On Sun, 17 Feb 2002, I wrote:
> >
> > > The logic in filbuf.c appears to be wrong when an EOF is encountered,
> > > setting stream->__error rather than stream->__eof. The following patch
> > > fixes this.
> >
> > Don't bother committing this, as it seems to break something. I'll post a
> > better solution when I found what the problem is.
> 
> OK, I was looking in the wrong place. filbuf.c is correct, the problem is
> in tty.c where an error is set when EOF is encountered in canonical input.

Thanks.  This is now committed.

Nick.

 
> Index: tty.c
> ===================================================================
> RCS file: /usr/local/cvsroot/gccsdk/unixlib/source/unix/tty.c,v
> retrieving revision 1.4.2.11
> diff -u -r1.4.2.11 tty.c
> --- tty.c	2002/01/12 16:06:57	1.4.2.11
> +++ tty.c	2002/03/04 11:39:36
> @@ -607,7 +607,7 @@
>    if (tty == __u->tty)
>      __os_byte (0xe5, 0, 0, 0);	/* Re-enable SIGINT.  */
> 
> -  if (tty->cnt == 0)
> +  if (tty->cnt == 0 && c != ceof)
>      return __set_errno (EAGAIN);
> 
>    return 0;
> 
> 
> -- 
> Alex Waugh                               alex at alexwaugh.com
> 
> PHP, Roots, WebJames and more from http://www.alexwaugh.com/



More information about the gcc mailing list