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: