[glib: 1/2] gtestdbus: Use posix_spawn() to spawn dbus-daemon
- From: Simon McVittie <smcv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 1/2] gtestdbus: Use posix_spawn() to spawn dbus-daemon
- Date: Wed, 26 Feb 2020 13:58:14 +0000 (UTC)
commit eb867c3d2fabcb005d964b553e79955276023fc8
Author: Philip Withnall <withnall endlessm com>
Date: Wed Feb 26 10:45:45 2020 +0000
gtestdbus: Use posix_spawn() to spawn dbus-daemon
This speeds up tests which use `GTestDBus` significantly.
Signed-off-by: Philip Withnall <withnall endlessm com>
gio/gtestdbus.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/gio/gtestdbus.c b/gio/gtestdbus.c
index 11cf029d9..633c93534 100644
--- a/gio/gtestdbus.c
+++ b/gio/gtestdbus.c
@@ -604,11 +604,12 @@ start_daemon (GTestDBus *self)
g_spawn_async_with_pipes (NULL,
(gchar **) argv,
NULL,
-#ifdef G_OS_WIN32
/* We Need this to get the pid returned on win32 */
G_SPAWN_DO_NOT_REAP_CHILD |
-#endif
- G_SPAWN_SEARCH_PATH,
+ G_SPAWN_SEARCH_PATH |
+ /* dbus-daemon will not abuse our descriptors, and
+ * passing this means we can use posix_spawn() for speed */
+ G_SPAWN_LEAVE_DESCRIPTORS_OPEN,
NULL,
NULL,
&self->priv->bus_pid,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]