1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-01 01:17:02 +00:00
freebsd-ports/x11/gdm/files/patch-common_gdm-log.c
2022-01-31 13:06:19 -08:00

34 lines
869 B
C

--- common/gdm-log.c.orig 2022-01-12 14:15:56 UTC
+++ common/gdm-log.c
@@ -30,7 +30,9 @@
#include <unistd.h>
#include <syslog.h>
+#ifdef WITH_SYSTEMD
#include <systemd/sd-daemon.h>
+#endif
#include <glib.h>
#include <glib/gstdio.h>
@@ -131,6 +133,20 @@ gdm_log_init (void)
initialized = TRUE;
g_log_set_default_handler (gdm_log_default_handler, NULL);
+
+#ifndef WITH_SYSTEMD
+ /* Only set up syslog if !systemd, otherwise with systemd
+ * enabled, we keep the default GLib log handler which goes to
+ * stderr, which is routed to the appropriate place in the
+ * systemd service file.
+ */
+ const char *prg_name = g_get_prgname ();
+ int options = LOG_PID;
+#ifdef LOG_PERROR
+ options |= LOG_PERROR;
+#endif
+ openlog (prg_name, options, LOG_DAEMON);
+#endif
}
void