mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-07-23 10:27:51 +02:00
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
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user