This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.21-173-g18d2675


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  18d26750dd8fd328a78cf639fd0ec2494680a2a4 (commit)
      from  9f95dc5d227c5a155d39208dfd15aacaa509b59b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=18d26750dd8fd328a78cf639fd0ec2494680a2a4

commit 18d26750dd8fd328a78cf639fd0ec2494680a2a4
Author: Paul Pluzhnikov <ppluzhnikov@google.com>
Date:   Sun Mar 8 09:46:53 2015 -0700

    Cleanup: in preparation for fixing BZ #16734, fix memory leaks exposed by
    switching fopen()ed streams from mmap to malloc.

diff --git a/ChangeLog b/ChangeLog
index 8de939f..4a5cd16 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2015-03-08  Paul Pluzhnikov  <ppluzhnikov@google.com>
+
+	[BZ #16734]
+	* libio/genops.c (_IO_unbuffer_all): Renamed from _IO_unbuffer_write.
+	Cleanup read-only streams as well.
+	(_IO_cleanup): Call _IO_unbuffer_all instead of _IO_unbuffer_write.
+
 2015-03-08  Samuel Thibault  <samuel.thibault@ens-lyon.org>
 
 	* sysdeps/mach/hurd/bits/libc-lock.h [_LIBC]: Include
diff --git a/libio/genops.c b/libio/genops.c
index 6612997..0f5e800 100644
--- a/libio/genops.c
+++ b/libio/genops.c
@@ -935,23 +935,21 @@ weak_alias (_IO_flush_all_linebuffered, _flushlbf)
    the atexit routine, just like _IO_cleanup.  The problem is we do
    not know whether the freeres code is called first or _IO_cleanup.
    if the former is the case, we set the DEALLOC_BUFFER variable to
-   true and _IO_unbuffer_write will take care of the rest.  If
-   _IO_unbuffer_write is called first we add the streams to a list
+   true and _IO_unbuffer_all will take care of the rest.  If
+   _IO_unbuffer_all is called first we add the streams to a list
    which the freeres function later can walk through.  */
-static void _IO_unbuffer_write (void);
+static void _IO_unbuffer_all (void);
 
 static bool dealloc_buffers;
 static _IO_FILE *freeres_list;
 
 static void
-_IO_unbuffer_write (void)
+_IO_unbuffer_all (void)
 {
   struct _IO_FILE *fp;
   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)
 	{
@@ -1019,7 +1017,7 @@ _IO_cleanup (void)
 
      The following will make the standard streambufs be unbuffered,
      which forces any output from late destructors to be written out. */
-  _IO_unbuffer_write ();
+  _IO_unbuffer_all ();
 
   return result;
 }

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog      |    7 +++++++
 libio/genops.c |   12 +++++-------
 2 files changed, 12 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]