glib r7116 - in branches/glib-2-16: . glib



Author: matthiasc
Date: Mon Jun 30 22:45:33 2008
New Revision: 7116
URL: http://svn.gnome.org/viewvc/glib?rev=7116&view=rev

Log:
        Bug 538119 â glib's mainloop leaks a pipe to sub-processes

        * glib/gmain.c (g_main_context_init_pipe): Don't leak the
        pipes to child processes. Patch by Thiago Macieira.



Modified:
   branches/glib-2-16/ChangeLog
   branches/glib-2-16/glib/gmain.c

Modified: branches/glib-2-16/glib/gmain.c
==============================================================================
--- branches/glib-2-16/glib/gmain.c	(original)
+++ branches/glib-2-16/glib/gmain.c	Mon Jun 30 22:45:33 2008
@@ -629,6 +629,9 @@
     g_error ("Cannot create pipe main loop wake-up: %s\n",
 	     g_strerror (errno));
   
+  fcntl (context->wake_up_pipe[0], F_SETFD, FD_CLOEXEC);
+  fcntl (context->wake_up_pipe[1], F_SETFD, FD_CLOEXEC);
+
   context->wake_up_rec.fd = context->wake_up_pipe[0];
   context->wake_up_rec.events = G_IO_IN;
 # else



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]