[glib] Add G_SPAWN_DEFAULT to GSpawnFlags
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] Add G_SPAWN_DEFAULT to GSpawnFlags
- Date: Sat, 17 Aug 2013 17:03:37 +0000 (UTC)
commit 37849277645d05c1e1cd9c5e585d7231f75ffa2f
Author: Robert Ancell <robert ancell canonical com>
Date: Fri May 31 11:07:55 2013 +1200
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
glib/gspawn.h | 2 ++
glib/tests/spawn-multithreaded.c | 2 +-
2 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/glib/gspawn.h b/glib/gspawn.h
index 24bd521..5b5853a 100644
--- a/glib/gspawn.h
+++ b/glib/gspawn.h
@@ -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() */
diff --git a/glib/tests/spawn-multithreaded.c b/glib/tests/spawn-multithreaded.c
index 781ae4a..99f99b4 100644
--- a/glib/tests/spawn-multithreaded.c
+++ b/glib/tests/spawn-multithreaded.c
@@ -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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]