gsettings: Emit glib logs on stderr, not stdout
authorScott Worley <scottworley@scottworley.com>
Mon, 14 Jun 2021 03:11:34 +0000 (20:11 -0700)
committerScott Worley <scottworley@scottworley.com>
Tue, 15 Jun 2021 18:46:20 +0000 (11:46 -0700)
commit9d273178738836d936a67498997b027ce0c72a72
tree1e82c3d0558a6dc37f486e28509d3e7384473c55
parent1a4fb0ff63cc6d98ba20088222408f5c1ca42185
gsettings: Emit glib logs on stderr, not stdout

Having G_MESSAGES_DEBUG=all set in the environment (a normal thing to do
when debugging Gnome troubles) causes gsettings-helper to emit a bunch
of helpful gnome debug logs (which is good), but before this change they
were printed on stdout rather than stderr (which was bad!).  Rather than
going somewhere the user could see, these log messages were being sent
to the pulesaudio server and interpreted as the src/modules/stdin-util.c
protocol.  pulseadio waits to see a '!' message from gsettings-helper
before continuing startup.  With the log messages mixed in messing up
the stdin-util protocol, pulseaudio never saw the '!' message, and so
never completed startup.

This simple fix relies on a recent glib > 2.68 (Mar 2021), so builds
against old versions of glib will still have this problem!  We consider
this good enough until some complains otherwise.

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/1222
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/579>
src/modules/gsettings/gsettings-helper.c