Merge branch '2322-fflush-test-dbus' into 'master'

gtestdbus: Flush stdout and stderr before forking a monitor process

Closes #2322

See merge request GNOME/glib!1950
This commit is contained in:
Simon McVittie 2021-02-15 10:58:06 +00:00
commit 985bb56996

View File

@ -251,6 +251,16 @@ watcher_init (void)
g_assert_not_reached (); g_assert_not_reached ();
} }
/* flush streams to avoid buffers being duplicated in the child and
* flushed by both the child and parent later
*
* FIXME: This is a workaround for the fact that watch_parent() uses
* non-async-signal-safe API. See
* https://gitlab.gnome.org/GNOME/glib/-/issues/2322#note_1034330
*/
fflush (stdout);
fflush (stderr);
switch (fork ()) switch (fork ())
{ {
case -1: case -1: