summaryrefslogtreecommitdiff
path: root/glib/gmain-internal.h
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2012-10-25 02:54:05 -0400
committerColin Walters <walters@verbum.org>2012-11-04 13:52:31 -0500
commit0e7ddcade1ae751a793049e0136db79bdc793adf (patch)
tree1658dc816a4acdf0eb525fe8069de5341569e58c /glib/gmain-internal.h
parent05034c0ff1e008ec668197fb4bb01e64b6734849 (diff)
downloadglib-wip/child-catchall.tar.gz
GChildWatchSource: Allow passing -1 for pidwip/child-catchall
With the goal of modifying gnome-session to use the new Linux PR_SET_CHILD_SUBREAPER, it needs to be able to reap arbitary children that may be reparented to it. But if gnome-session is going to continue to work with GLib and GIO, even if we converted all child watches in gnome-session to use this new API, we'd still have to contend with the possibility of it having a process spawned indirectly (stuff like the GDBus dbus-launch invocation). Thus, we don't give the -1 child watch *every* waitpid, only the ones which don't have a specific watcher. Also, fix up g_spawn_sync() to hold the unix signal lock when forking. This way we ensure that GLib itself gets the waitpid() result for the synchronously spawned child, instead of racing with the worker thread. https://bugzilla.gnome.org/show_bug.cgi?id=687061
Diffstat (limited to 'glib/gmain-internal.h')
-rw-r--r--glib/gmain-internal.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/glib/gmain-internal.h b/glib/gmain-internal.h
index 648aff3e6..ef13ff8ff 100644
--- a/glib/gmain-internal.h
+++ b/glib/gmain-internal.h
@@ -30,6 +30,10 @@ G_BEGIN_DECLS
GSource *_g_main_create_unix_signal_watch (int signum);
+#ifdef G_OS_UNIX
+GPid _g_main_fork_and_do_not_reap (void);
+#endif
+
G_END_DECLS
#endif /* __G_MAIN_H__ */