From e25938d52731e1dc59b4aeaaec186578f8cd16af Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Thu, 21 Mar 2013 09:24:21 +0100 Subject: [PATCH] Fix test for logind availability sd_booted() is not an appropriate check for whether we should talk to logind, test for /run/systemd/seats/ instead. For details, see: Bug: https://bugs.freedesktop.org/show_bug.cgi?id=62585 [trivial whitespace fix -smcv] Reviewed-by: Simon McVittie --- dbus/dbus-userdb-util.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dbus/dbus-userdb-util.c b/dbus/dbus-userdb-util.c index 16bf2291..5af00922 100644 --- a/dbus/dbus-userdb-util.c +++ b/dbus/dbus-userdb-util.c @@ -21,6 +21,7 @@ * */ #include +#include #define DBUS_USERDB_INCLUDES_PRIVATE 1 #include "dbus-userdb.h" #include "dbus-test.h" @@ -29,7 +30,6 @@ #include #if HAVE_SYSTEMD -#include #include #endif @@ -55,7 +55,8 @@ _dbus_is_console_user (dbus_uid_t uid, dbus_bool_t result = FALSE; #ifdef HAVE_SYSTEMD - if (sd_booted () > 0) + /* check if we have logind */ + if (access ("/run/systemd/seats/", F_OK) >= 0) { int r;