diff options
author | Ulrich Drepper <drepper@redhat.com> | 2007-10-13 07:20:46 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2007-10-13 07:20:46 +0000 |
commit | ed36f224c30088f10ecb0f190091508e917379a3 (patch) | |
tree | 6390edb48cdfa439d669a523690b1359980ff222 | |
parent | 0ea4967708e69a518d7a141ebab328e6d58b5401 (diff) | |
download | glibc-ed36f224c30088f10ecb0f190091508e917379a3.zip glibc-ed36f224c30088f10ecb0f190091508e917379a3.tar.gz glibc-ed36f224c30088f10ecb0f190091508e917379a3.tar.bz2 |
write-only streams. For read/write streams, check whether we
performed a read operation already.
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | libio/__freading.c | 6 |
2 files changed, 5 insertions, 4 deletions
@@ -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> diff --git a/libio/__freading.c b/libio/__freading.c index 7eca27b..43e50bc 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)); } |