]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
write-only streams. For read/write streams, check whether we
authorUlrich Drepper <drepper@redhat.com>
Sat, 13 Oct 2007 07:20:46 +0000 (07:20 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sat, 13 Oct 2007 07:20:46 +0000 (07:20 +0000)
performed a read operation already.

ChangeLog
libio/__freading.c

index 3a16e6ac8f9b33223698d6bba17adbe38b2f13ef..89ec38ca1666255b4572113efb655f180e661cbb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,7 +2,8 @@
 
        [BZ #4359]
        * libio/__freading.c (__freading): Don't return true for
-       write-only streams.
+       write-only streams.  For read/write streams, check whether we
+       performed a read operation already.
 
 2007-10-12  Ulrich Drepper  <drepper@redhat.com>
 
index 7eca27b010eae12726e9b0b494be2b588a21d7a2..43e50bce75aa23fa3b5f806c1eb7266301bb9666 100644 (file)
@@ -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));
 }