Add g_spawn_check_exit_status()

Many (if not "almost all") programs that spawn other programs via
g_spawn_sync() or the like simply want to check whether or not the
child exited successfully, but doing so requires use of
platform-specific functionality and there's actually a fair amount of
boilerplate involved.

This new API will help drain a *lot* of mostly duplicated code in
GNOME, from gnome-session to gdm.  And we can see that some bits even
inside GLib were doing it wrong; for example checking the exit status
on Unix, but ignoring it on Windows.

https://bugzilla.gnome.org/show_bug.cgi?id=679691
This commit is contained in:
Colin Walters
2012-07-10 11:27:22 -04:00
parent 82d914d808
commit f7abd3ce13
11 changed files with 161 additions and 67 deletions

View File

@@ -1093,6 +1093,7 @@ GSpawnChildSetupFunc
g_spawn_async_with_pipes
g_spawn_async
g_spawn_sync
g_spawn_check_exit_status
g_spawn_command_line_async
g_spawn_command_line_sync
g_spawn_close_pid