diff --git a/gio/gio-launch-desktop.c b/gio/gio-launch-desktop.c index 1af25e739..9ed6712f7 100644 --- a/gio/gio-launch-desktop.c +++ b/gio/gio-launch-desktop.c @@ -47,6 +47,8 @@ #include #include +#include "gjournal-private.h" + /* * write_all: * @fd: a file descriptor @@ -189,6 +191,9 @@ set_up_journal (const char *argv1) const char *slash; int fd; + if (!_g_fd_is_journal (STDOUT_FILENO) && !_g_fd_is_journal (STDERR_FILENO)) + return; + identifier = getenv ("GIO_LAUNCHED_DESKTOP_FILE"); if (identifier == NULL) diff --git a/gio/meson.build b/gio/meson.build index 9557464e8..69bb0603e 100644 --- a/gio/meson.build +++ b/gio/meson.build @@ -400,8 +400,14 @@ if host_system != 'windows' contenttype_sources += files('gcontenttype.c') appinfo_sources += files('gdesktopappinfo.c') gio_unix_include_headers += files('gdesktopappinfo.h') + launch_desktop_sources = files('gio-launch-desktop.c') - gio_launch_desktop = executable('gio-launch-desktop', 'gio-launch-desktop.c', + if host_system == 'linux' + launch_desktop_sources += files('../glib/gjournal-private.c') + endif + + gio_launch_desktop = executable('gio-launch-desktop', launch_desktop_sources, + include_directories : glibinc, install : true, install_dir : multiarch_libexecdir, c_args : gio_c_args,