chiark / gitweb /
unit: introduce ConditionFileIsExecutable= and use it where we check for a binary...
[elogind.git] / src / logind-user-dbus.c
index 623f2c9c24a044a7a659c5154c51643b3569af25..7263d1b757265ecc2504224a94524625b0a71a3f 100644 (file)
@@ -121,7 +121,7 @@ static int bus_user_append_sessions(DBusMessageIter *i, const char *property, vo
         assert(property);
         assert(u);
 
-        if (!dbus_message_iter_open_container(i, DBUS_TYPE_ARRAY, "so", &sub))
+        if (!dbus_message_iter_open_container(i, DBUS_TYPE_ARRAY, "(so)", &sub))
                 return -ENOMEM;
 
         LIST_FOREACH(sessions_by_user, session, u->sessions) {
@@ -154,13 +154,14 @@ static int bus_user_append_sessions(DBusMessageIter *i, const char *property, vo
 
 static int bus_user_append_idle_hint(DBusMessageIter *i, const char *property, void *data) {
         User *u = data;
-        bool b;
+        dbus_bool_t b;
 
         assert(i);
         assert(property);
         assert(u);
 
-        b = user_get_idle_hint(u, NULL);
+        b = user_get_idle_hint(u, NULL) > 0;
+
         if (!dbus_message_iter_append_basic(i, DBUS_TYPE_BOOLEAN, &b))
                 return -ENOMEM;
 
@@ -361,6 +362,9 @@ int user_send_changed(User *u, const char *properties) {
 
         assert(u);
 
+        if (!u->started)
+                return 0;
+
         p = user_bus_path(u);
         if (!p)
                 return -ENOMEM;