diff mbox

Fix failure to cleanup wide stream buffers in preparation for BZ#16734 fix

Message ID CALoOobPZ9HcdiFqOyXW6+hetSeKMzUYCk1yPQk1_Y9-Ja_46HQ@mail.gmail.com
State New
Headers show

Commit Message

Paul Pluzhnikov July 12, 2015, 7:22 p.m. UTC
Greetings,

In preparation for BZ#16734 fix, I've build libc with (not intended to commit):

 # include <fcntl.h>
... etc.

This results in mtrace test failure:
FAIL: misc/tst-error1-mem

Attached patch fixes the test failure.

Thanks,

Comments

Siddhesh Poyarekar July 15, 2015, 11:18 a.m. UTC | #1
On Sun, Jul 12, 2015 at 12:22:03PM -0700, Paul Pluzhnikov wrote:
> 2015-07-12  Paul Pluzhnikov  <ppluzhnikov@google.com>
> 
>         [BZ #16734]
>         * libio/genops.c (_IO_unbuffer_all): Free wide buffer as well.

Looks good to me.

thanks,
Siddhesh

> diff --git a/libio/genops.c b/libio/genops.c
> index 0f5e800..e13b3d1 100644
> --- a/libio/genops.c
> +++ b/libio/genops.c
> @@ -977,6 +977,9 @@ _IO_unbuffer_all (void)
>  
>  	  _IO_SETBUF (fp, NULL, 0);
>  
> +	  if (fp->_mode > 0)
> +	    _IO_wsetb (fp, NULL, NULL, 0);
> +
>  #ifdef _IO_MTSAFE_IO
>  	  if (cnt < MAXTRIES && fp->_lock != NULL)
>  	    _IO_lock_unlock (*fp->_lock);
Paul Pluzhnikov Aug. 8, 2015, 11:30 p.m. UTC | #2
On Wed, Jul 15, 2015 at 4:18 AM, Siddhesh Poyarekar <siddhesh@redhat.com> wrote:
> On Sun, Jul 12, 2015 at 12:22:03PM -0700, Paul Pluzhnikov wrote:
>> 2015-07-12  Paul Pluzhnikov  <ppluzhnikov@google.com>
>>
>>         [BZ #16734]
>>         * libio/genops.c (_IO_unbuffer_all): Free wide buffer as well.
>
> Looks good to me.

Thanks. Committed as a601b74d31ca086de38441d316a3dee24c866305.
diff mbox

Patch

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>