diff --git a/gio/gtestdbus.c b/gio/gtestdbus.c index 9cfaadbf0..d362f9478 100644 --- a/gio/gtestdbus.c +++ b/gio/gtestdbus.c @@ -251,6 +251,16 @@ watcher_init (void) 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 ()) { case -1: