Skip to content

glib-backports: Avoid g_log_writer_is_journald() on GLib 2.58.x

Simon McVittie requested to merge wip/task461-journal-regression into main

This function is present in GLib 2.58.x, but had a bug: it cached its result, even if called on different file descriptors. Normally this doesn't matter, because normally this function is only called on either stdout or stderr anyway, and if one of them is the Journal, usually the other one is too.

Unfortunately, log.c calls g_log_writer_is_journald (STDOUT_FILENO) before g_log_writer_is_journald (STDERR_FILENO); and on Steam Deck, when using logger-0.bash, srt-logger gets invoked with stdout pointing to a pipe and stderr to the Journal. So we would cache the result "not the Journal" from stdout, and then use it for stderr.

Use a backport of the fixed version (or, in fact, the internal function that it calls) instead of the GLib 2.58 version.

steamrt/tasks#461

/cc @refi64 @denittis

Merge request reports