Skip to content

Commit

Permalink
[BZ #4359]
Browse files Browse the repository at this point in the history
2007-10-13  Ulrich Drepper  <drepper@redhat.com>
	[BZ #4359]
	* libio/__freading.c (__freading): Don't return true for
	write-only streams.
  • Loading branch information
Ulrich Drepper committed Oct 13, 2007
1 parent fab1a49 commit 0ea4967
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2007-10-13 Ulrich Drepper <drepper@redhat.com>

[BZ #4359]
* libio/__freading.c (__freading): Don't return true for
write-only streams.

2007-10-12 Ulrich Drepper <drepper@redhat.com>

* locale/programs/repertoire.c (repertoire_read): Always free
Expand Down
7 changes: 4 additions & 3 deletions libio/__freading.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (C) 2000, 2002 Free Software Foundation, Inc.
/* Copyright (C) 2000, 2002, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
Expand All @@ -21,6 +21,7 @@
int
__freading (FILE *fp)
{
return ((fp->_flags & _IO_NO_WRITES)
|| (fp->_flags & _IO_CURRENTLY_PUTTING) == 0);
return (((fp->_flags & _IO_NO_WRITES)
|| (fp->_flags & _IO_CURRENTLY_PUTTING) == 0)
&& (fp->_flags & _IO_NO_READS) == 0);
}

0 comments on commit 0ea4967

Please sign in to comment.