summaryrefslogtreecommitdiff
path: root/glib/glib-private.c
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2012-05-21 17:09:06 -0400
committerColin Walters <walters@verbum.org>2012-11-14 14:11:57 -0500
commit93bf37ce1507380f74d4cb4cab6640fc7d2eb7d1 (patch)
tree4830a5dd1363c91ad1e2721ab2a221476775ff19 /glib/glib-private.c
parente744a4aa7a5b6e7b0fb3bd9e553b152ce424992c (diff)
downloadglib-93bf37ce1507380f74d4cb4cab6640fc7d2eb7d1.tar.gz
gmain: Add private API to create Unix child watch that uses waitid()
This avoids collecting the zombie child, which means that the PID can't be reused. This prevents possible race conditions that might occur were one to send e.g. SIGTERM to a child. This race condition has always existed due to the way we called waitpid() for the app, but the window was widened when we moved the waitpid() calls into a separate thread. If waitid() isn't available, we return NULL, and consumers of this private API (namely, GSubprocess) will need to handle that. https://bugzilla.gnome.org/show_bug.cgi?id=672102
Diffstat (limited to 'glib/glib-private.c')
-rw-r--r--glib/glib-private.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/glib/glib-private.c b/glib/glib-private.c
index e7838a600..c2346c5e3 100644
--- a/glib/glib-private.c
+++ b/glib/glib-private.c
@@ -41,7 +41,8 @@ glib__private__ (void)
g_get_worker_context,
g_check_setuid,
- g_main_context_new_with_next_id
+ g_main_context_new_with_next_id,
+ g_child_watch_source_new_nowait
};
return &table;