Don't leak the pipes to child processes. Patch by Thiago Macieira.

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


svn path=/trunk/; revision=7037
This commit is contained in:
Matthias Clasen
2008-06-13 14:11:03 +00:00
parent 43eeb244ac
commit 4c78992dbf
2 changed files with 11 additions and 1 deletions

View File

@@ -669,7 +669,10 @@ g_main_context_init_pipe (GMainContext *context)
if (pipe (context->wake_up_pipe) < 0)
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