Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
write-only streams. For read/write streams, check whether we
	performed a read operation already.
  • Loading branch information
Ulrich Drepper committed Oct 13, 2007
1 parent 0ea4967 commit ed36f22
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion ChangeLog
Expand Up @@ -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>

Expand Down
6 changes: 3 additions & 3 deletions libio/__freading.c
Expand Up @@ -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));
}

0 comments on commit ed36f22

Please sign in to comment.