gmain: Add private API to create Unix child watch that uses waitid()
authorColin Walters <walters@verbum.org>
Mon, 21 May 2012 21:09:06 +0000 (17:09 -0400)
committerColin Walters <walters@verbum.org>
Wed, 14 Nov 2012 19:11:57 +0000 (14:11 -0500)
commit93bf37ce1507380f74d4cb4cab6640fc7d2eb7d1
tree4830a5dd1363c91ad1e2721ab2a221476775ff19
parente744a4aa7a5b6e7b0fb3bd9e553b152ce424992c
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
configure.ac
glib/glib-private.c
glib/glib-private.h
glib/gmain.c