From 580345725c57c4f339bbac9dd4137a8f17c9a88a Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Wed, 21 Jul 1999 13:24:21 +0000 Subject: [PATCH] * libio/fileops.c (_IO_new_file_underflow): Set error indicator when reading from write-only stream. * libio/oldfileops.c (_IO_old_file_underflow): Likewise. * libio/wfileops.c (_IO_wfile_underflow): Likewise. 1999-07-21 Andreas Schwab --- ChangeLog | 7 +++++++ libio/fileops.c | 1 + libio/oldfileops.c | 1 + libio/wfileops.c | 1 + 4 files changed, 10 insertions(+) diff --git a/ChangeLog b/ChangeLog index aea5664..f78d1aa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 1999-07-21 Andreas Schwab + * libio/fileops.c (_IO_new_file_underflow): Set error indicator + when reading from write-only stream. + * libio/oldfileops.c (_IO_old_file_underflow): Likewise. + * libio/wfileops.c (_IO_wfile_underflow): Likewise. + +1999-07-21 Andreas Schwab + * nss/test-netdb.c (output_hostent): Don't crash if h_aliases is NULL. diff --git a/libio/fileops.c b/libio/fileops.c index 8ced77b..decb9d7 100644 --- a/libio/fileops.c +++ b/libio/fileops.c @@ -358,6 +358,7 @@ _IO_new_file_underflow (fp) if (fp->_flags & _IO_NO_READS) { + fp->_flags |= _IO_ERR_SEEN; __set_errno (EBADF); return EOF; } diff --git a/libio/oldfileops.c b/libio/oldfileops.c index 0244521..fd118a6 100644 --- a/libio/oldfileops.c +++ b/libio/oldfileops.c @@ -314,6 +314,7 @@ _IO_old_file_underflow (fp) if (fp->_flags & _IO_NO_READS) { + fp->_flags |= _IO_ERR_SEEN; __set_errno (EBADF); return EOF; } diff --git a/libio/wfileops.c b/libio/wfileops.c index f3f8bf2..3489b36 100644 --- a/libio/wfileops.c +++ b/libio/wfileops.c @@ -120,6 +120,7 @@ _IO_wfile_underflow (fp) if (fp->_flags & _IO_NO_READS) { + fp->_flags |= _IO_ERR_SEEN; __set_errno (EBADF); return WEOF; } -- 2.7.4