mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-24 19:22:11 +01:00
Add G_SPAWN_DEFAULT to GSpawnFlags
This is convenient for language bindings, and also makes invocations of g_spawn functions in C more readable. https://bugzilla.gnome.org/show_bug.cgi?id=701318
This commit is contained in:
parent
8b3d779d1e
commit
3784927764
@ -144,6 +144,7 @@ typedef void (* GSpawnChildSetupFunc) (gpointer user_data);
|
||||
|
||||
/**
|
||||
* GSpawnFlags:
|
||||
* @G_SPAWN_DEFAULT: no flags, default behaviour
|
||||
* @G_SPAWN_LEAVE_DESCRIPTORS_OPEN: the parent's open file descriptors will be
|
||||
* inherited by the child; otherwise all descriptors except stdin/stdout/stderr
|
||||
* will be closed before calling exec() in the child.
|
||||
@ -171,6 +172,7 @@ typedef void (* GSpawnChildSetupFunc) (gpointer user_data);
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
G_SPAWN_DEFAULT = 0,
|
||||
G_SPAWN_LEAVE_DESCRIPTORS_OPEN = 1 << 0,
|
||||
G_SPAWN_DO_NOT_REAP_CHILD = 1 << 1,
|
||||
/* look for argv[0] in the path i.e. use execvp() */
|
||||
|
@ -72,7 +72,7 @@ test_spawn_sync_multithreaded_instance (gpointer data)
|
||||
g_ptr_array_add (argv, arg);
|
||||
g_ptr_array_add (argv, NULL);
|
||||
|
||||
g_spawn_sync (NULL, (char**)argv->pdata, NULL, 0, NULL, NULL, &stdout_str, NULL, &estatus, &error);
|
||||
g_spawn_sync (NULL, (char**)argv->pdata, NULL, G_SPAWN_DEFAULT, NULL, NULL, &stdout_str, NULL, &estatus, &error);
|
||||
g_assert_no_error (error);
|
||||
g_assert_cmpstr (arg, ==, stdout_str);
|
||||
g_free (arg);
|
||||
|
Loading…
x
Reference in New Issue
Block a user