This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [patch] Fix failure to cleanup input-only stream buffers in preparation for BZ#16734 fix
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: Paul Pluzhnikov <ppluzhnikov at gmail dot com>, GLIBC Devel <libc-alpha at sourceware dot org>
- Date: Sun, 08 Mar 2015 14:47:05 -0400
- Subject: Re: [patch] Fix failure to cleanup input-only stream buffers in preparation for BZ#16734 fix
- Authentication-results: sourceware.org; auth=none
- References: <CALoOobNy2mS=YFF63Hjz_+ewDPtjRa+Jyo_tofUM+vVkrS3bYA at mail dot gmail dot com>
On 02/16/2015 08:07 PM, Paul Pluzhnikov wrote:
> bz16734-cleanup.patch2.txt
>
>
> diff --git a/libio/genops.c b/libio/genops.c
> index 6612997..094598f 100644
> --- a/libio/genops.c
> +++ b/libio/genops.c
> @@ -950,8 +950,6 @@ _IO_unbuffer_write (void)
> for (fp = (_IO_FILE *) _IO_list_all; fp; fp = fp->_chain)
> {
> if (! (fp->_flags & _IO_UNBUFFERED)
> - && (! (fp->_flags & _IO_NO_WRITES)
> - || (fp->_flags & _IO_IS_APPENDING))
> /* Iff stream is un-orientated, it wasn't used. */
> && fp->_mode != 0)
> {
I know you already committed this, but I wanted to mention that
I just reviewed this and it looks OK to me.
It would have been nice to have added a specific test case to
catch this instead of relying on other orthogonal test cases.
Please still consider adding a test case for this specific
failure.
I had a lot of difficulty untying the POSIX stream, and fd
requirements the last time I touched this code, and Siddhesh
helped write several more key regression tests to encode
the expectations we had as seen in [1][2]. While that is not
relevant here, what is relevant is making sure we have good
and clear regression test coverage.
Cheers,
Carlos.
[1] https://sourceware.org/glibc/wiki/File%20offsets%20in%20a%20stdio%20stream%20and%20ftell
[2] "2.5.1 Interaction of File Descriptors and Standard I/O Streams"
http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html