chiark / gitweb /
install: don't choke on dead links
[elogind.git] / src / logind-seat-dbus.c
index 1895fe6cc36c2e4531a6846d014ec46e2654092b..669e83e82d5e035ee32fbd2e805ec87387e92acb 100644 (file)
@@ -102,7 +102,7 @@ static int bus_seat_append_sessions(DBusMessageIter *i, const char *property, vo
         assert(property);
         assert(s);
 
-        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_seat, session, s->sessions) {
@@ -151,13 +151,13 @@ static int bus_seat_append_can_activate(DBusMessageIter *i, const char *property
 
 static int bus_seat_append_idle_hint(DBusMessageIter *i, const char *property, void *data) {
         Seat *s = data;
-        bool b;
+        dbus_bool_t b;
 
         assert(i);
         assert(property);
         assert(s);
 
-        b = seat_get_idle_hint(s, NULL);
+        b = seat_get_idle_hint(s, NULL) > 0;
         if (!dbus_message_iter_append_basic(i, DBUS_TYPE_BOOLEAN, &b))
                 return -ENOMEM;
 
@@ -378,6 +378,9 @@ int seat_send_changed(Seat *s, const char *properties) {
 
         assert(s);
 
+        if (!s->started)
+                return 0;
+
         p = seat_bus_path(s);
         if (!p)
                 return -ENOMEM;