From df1a3e961f9c4566ca090dbaefe9d3b2cb8c0eae Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Tue, 27 Nov 2018 19:24:35 +0100 Subject: [PATCH] gtestutils: pass open file descriptors to subprocess The subprocess needs to access the test_log_fd. If the file descriptors are not left open, functions such as g_test_message may stomp on file descriptors open by the subprocess and cause bad behavior of the test. --- glib/gtestutils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glib/gtestutils.c b/glib/gtestutils.c index 874d5dc068..afa3206ba1 100644 --- a/glib/gtestutils.c +++ b/glib/gtestutils.c @@ -3173,7 +3173,7 @@ g_test_trap_subprocess (const char *test_path, } g_ptr_array_add (argv, NULL); - flags = G_SPAWN_DO_NOT_REAP_CHILD; + flags = G_SPAWN_DO_NOT_REAP_CHILD | G_SPAWN_LEAVE_DESCRIPTORS_OPEN; if (test_flags & G_TEST_TRAP_INHERIT_STDIN) flags |= G_SPAWN_CHILD_INHERITS_STDIN; -- GitLab