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: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Paul Pluzhnikov <ppluzhnikov at gmail dot com>
- Cc: GLIBC Devel <libc-alpha at sourceware dot org>
- Date: Sun, 8 Mar 2015 07:44:09 -0700
- 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 Mon, Feb 16, 2015 at 5:07 PM, Paul Pluzhnikov <ppluzhnikov@gmail.com> wrote:
> Greetings,
>
> In preparation for BZ#16734 fix, I've build libc with (not intended to commit):
>
> diff --git a/libio/libioP.h b/libio/libioP.h
> index d8604ca..d1699de 100644
> --- a/libio/libioP.h
> +++ b/libio/libioP.h
> @@ -719,7 +719,7 @@ extern _IO_off64_t _IO_seekpos_unlocked (_IO_FILE
> *, _IO_off64_t, int)
> # endif
> #endif
>
> -#if _G_HAVE_MMAP
> +#if _G_HAVE_MMAP && 0
>
> # include <unistd.h>
> # include <fcntl.h>
> ... etc.
>
> This results in 3 mtrace failures:
>
> FAIL: misc/tst-error1-mem
> FAIL: posix/bug-regex31-mem
> FAIL: posix/tst-fnmatch-mem
>
> The last two of them are because input-only FILE streams need the same
> buffer cleanup as writable streams.
>
> Attached patch fixes these two failures.
>
>
> 2015-02-16 Paul Pluzhnikov <ppluzhnikov@google.com>
>
> * libio/genops.c (_IO_unbuffer_write): Cleanup read-only
> streams as well.
It looks good to me, except for the name of the function,
_IO_unbuffer_write, which was changed by
1998-11-29 1998 H.J. Lu <hjl@gnu.org>
* libio/genops.c (_IO_unbuffer_write): Renamed from
_IO_unbuffer_all.
(_IO_cleanup): Call _IO_unbuffer_write instead of
_IO_unbuffer_all.
With this patch, the original name makes more senses now.
OK with the original function name.
Thanks.
--
H.J.