From 064ebd55bb838a4225e8cb525717e315c29d4d8b Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Thu, 21 Mar 2013 11:47:56 +0100 Subject: Fix checks for logind It is possible to build systemd without logind or run logind without systemd init, in both cases testing for systemd init is wrong. Check for /run/systemd/seats in the parts which talk to logind instead, as recommended by systemd upstream. For details, see: https://bugzilla.gnome.org/show_bug.cgi?id=696266 --- daemon/gdm-server.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'daemon/gdm-server.c') diff --git a/daemon/gdm-server.c b/daemon/gdm-server.c index 01fc5d48..91a04e63 100644 --- a/daemon/gdm-server.c +++ b/daemon/gdm-server.c @@ -39,10 +39,6 @@ #include #endif -#ifdef WITH_SYSTEMD -#include -#endif - #ifdef WITH_PLYMOUTH #include #endif @@ -173,7 +169,7 @@ char * gdm_server_get_display_device (GdmServer *server) { #ifdef WITH_SYSTEMD - if (sd_booted () > 0) { + if (LOGIND_RUNNING()) { /* systemd finds the display device out on its own based on the display */ return NULL; } @@ -275,7 +271,7 @@ gdm_server_init_command (GdmServer *server) * wasn't booted using systemd, or b) the wrapper tool is * missing, or c) we are running for the main seat 'seat0'. */ - if (sd_booted () <= 0) { + if (!LOGIND_RUNNING()) { goto fallback; } @@ -345,7 +341,7 @@ gdm_server_resolve_command_line (GdmServer *server, } #ifdef WITH_SYSTEMD - if (sd_booted () > 0 && server->priv->display_seat_id != NULL) { + if (LOGIND_RUNNING() && server->priv->display_seat_id != NULL) { argv[len++] = g_strdup ("-seat"); argv[len++] = g_strdup (server->priv->display_seat_id); } @@ -745,7 +741,7 @@ gdm_server_start (GdmServer *server) #ifdef WITH_SYSTEMD /* undo the hardcoding if we are an auxillary seat */ - if (sd_booted () > 0) { + if (LOGIND_RUNNING()) { if (strcmp (server->priv->display_seat_id, "seat0") != 0) { vtarg = NULL; } -- cgit v1.2.1