From ed36f224c30088f10ecb0f190091508e917379a3 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 13 Oct 2007 07:20:46 +0000 Subject: write-only streams. For read/write streams, check whether we performed a read operation already. --- libio/__freading.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libio/__freading.c') diff --git a/libio/__freading.c b/libio/__freading.c index 7eca27b010..43e50bce75 100644 --- a/libio/__freading.c +++ b/libio/__freading.c @@ -21,7 +21,7 @@ int __freading (FILE *fp) { - return (((fp->_flags & _IO_NO_WRITES) - || (fp->_flags & _IO_CURRENTLY_PUTTING) == 0) - && (fp->_flags & _IO_NO_READS) == 0); + return ((fp->_flags & _IO_NO_WRITES) + || ((fp->_flags & (_IO_CURRENTLY_PUTTING | _IO_NO_READS)) == 0 + && fp->_IO_read_base != NULL)); } -- cgit 1.4.1