(__freading): For read/write streams, check whether we performed a
authordrepper <drepper>
Sat, 13 Oct 2007 07:20:16 +0000 (07:20 +0000)
committerdrepper <drepper>
Sat, 13 Oct 2007 07:20:16 +0000 (07:20 +0000)
read operation already.

libio/__freading.c

index c271388..43e50bc 100644 (file)
@@ -22,5 +22,6 @@ int
 __freading (FILE *fp)
 {
   return ((fp->_flags & _IO_NO_WRITES)
-         || (fp->_flags & (_IO_CURRENTLY_PUTTING | _IO_NO_READS)) == 0);
+         || ((fp->_flags & (_IO_CURRENTLY_PUTTING | _IO_NO_READS)) == 0
+             && fp->_IO_read_base != NULL));
 }