summaryrefslogtreecommitdiff
path: root/daemon/gdm-server.c
diff options
context:
space:
mode:
authorMartin Pitt <martinpitt@gnome.org>2013-03-21 11:47:56 +0100
committerMartin Pitt <martinpitt@gnome.org>2013-03-29 11:04:18 +0100
commit064ebd55bb838a4225e8cb525717e315c29d4d8b (patch)
tree16e9d8f8c0ad56ca6eb3157fc173e6ef3d3eef96 /daemon/gdm-server.c
parent1fe1e565300eb9472cfc4348e4bceef5ef25512a (diff)
downloadgdm-064ebd55bb838a4225e8cb525717e315c29d4d8b.tar.gz
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://mail.gnome.org/archives/desktop-devel-list/2013-March/msg00092.html> https://bugzilla.gnome.org/show_bug.cgi?id=696266
Diffstat (limited to 'daemon/gdm-server.c')
-rw-r--r--daemon/gdm-server.c12
1 files changed, 4 insertions, 8 deletions
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 <sys/prctl.h>
#endif
-#ifdef WITH_SYSTEMD
-#include <systemd/sd-daemon.h>
-#endif
-
#ifdef WITH_PLYMOUTH
#include <linux/vt.h>
#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;
}