summaryrefslogtreecommitdiff
path: root/gio/gio-launch-desktop.c
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2022-07-14 14:30:30 +0100
committerPhilip Withnall <pwithnall@endlessos.org>2022-07-25 01:00:54 +0200
commitf73641482586bd3e49b73067569aa79ecd56aa5d (patch)
tree41f4bb718166ec9d42efc49cd0a9c825ea00ef76 /gio/gio-launch-desktop.c
parent6c3e52bb1d3e7977b90c7a8d61cc464ca8e7fb42 (diff)
downloadglib-f73641482586bd3e49b73067569aa79ecd56aa5d.tar.gz
gio-launch-desktop: Don't alter stdout/stderr if not already the Journal
Signed-off-by: Simon McVittie <smcv@collabora.com>
Diffstat (limited to 'gio/gio-launch-desktop.c')
-rw-r--r--gio/gio-launch-desktop.c5
1 files changed, 5 insertions, 0 deletions
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 <sys/socket.h>
#include <sys/un.h>
+#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)