sd_booted() is not an appropriate check for whether we should talk to logind,
test for /run/systemd/seats/ instead.
For details, see:
<https://mail.gnome.org/archives/desktop-devel-list/2013-March/msg00092.html>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=62585
[trivial whitespace fix -smcv]
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
*
*/
#include <config.h>
+#include <unistd.h>
#define DBUS_USERDB_INCLUDES_PRIVATE 1
#include "dbus-userdb.h"
#include "dbus-test.h"
#include <string.h>
#if HAVE_SYSTEMD
-#include <systemd/sd-daemon.h>
#include <systemd/sd-login.h>
#endif
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;