From faf349a2f92d89daf273a77b27691b068417696b Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 30 Jun 2008 22:45:33 +0000 Subject: [PATCH] =?UTF-8?q?=20=20=20=20=20=20=20=20Bug=20538119=20?= =?UTF-8?q?=E2=80=93=20glib's=20mainloop=20leaks=20a=20pipe=20to=20sub-pro?= =?UTF-8?q?cesses?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * glib/gmain.c (g_main_context_init_pipe): Don't leak the pipes to child processes. Patch by Thiago Macieira. svn path=/branches/glib-2-16/; revision=7116 --- ChangeLog | 9 +++++++++ glib/gmain.c | 3 +++ 2 files changed, 12 insertions(+) diff --git a/ChangeLog b/ChangeLog index 726951d4a..19294aa74 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-06-30 Matthias Clasen + + Backport from trunk: + + 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. + 2008-06-30 Matthias Clasen Backport from trunk: diff --git a/glib/gmain.c b/glib/gmain.c index b90bd8baf..f978154fd 100644 --- a/glib/gmain.c +++ b/glib/gmain.c @@ -629,6 +629,9 @@ g_main_context_init_pipe (GMainContext *context) 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