]> err.no Git - systemd/commitdiff
logind: make idle hint logic work
authorLennart Poettering <lennart@poettering.net>
Tue, 21 Jun 2011 20:29:25 +0000 (22:29 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 21 Jun 2011 20:29:25 +0000 (22:29 +0200)
src/logind-dbus.c
src/logind-seat-dbus.c
src/logind-seat.c
src/logind-session-dbus.c
src/logind-user-dbus.c

index f73307f806c8abc12cf50da64fe9f2871bd4de77..662ffd0be5e9628b8b947c13c19a218fae3033ec 100644 (file)
 
 static int bus_manager_append_idle_hint(DBusMessageIter *i, const char *property, void *data) {
         Manager *m = data;
-        bool b;
+        dbus_bool_t b;
 
         assert(i);
         assert(property);
         assert(m);
 
-        b = manager_get_idle_hint(m, NULL);
+        b = manager_get_idle_hint(m, NULL) > 0;
         if (!dbus_message_iter_append_basic(i, DBUS_TYPE_BOOLEAN, &b))
                 return -ENOMEM;
 
index 1895fe6cc36c2e4531a6846d014ec46e2654092b..4a4527d01ddfdf2afb53a7b09ad81b77ee7dfbfe 100644 (file)
@@ -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;
 
index 09356b6b09488fba05f903ba02d0db118532873d..12a1b806470efee273cc7a891c20d4afede58f3b 100644 (file)
@@ -230,8 +230,7 @@ int seat_set_active(Seat *s, Session *session) {
         Session *old_active;
 
         assert(s);
-        assert(session);
-        assert(session->seat == s);
+        assert(!session || session->seat == s);
 
         if (session == s->active)
                 return 0;
index 0ce880c590b80f9323a404d33fa753af762b04b7..b0e592d21560f3339d671604e797090d2eeef301 100644 (file)
@@ -144,7 +144,7 @@ static int bus_session_append_user(DBusMessageIter *i, const char *property, voi
 
 static int bus_session_append_active(DBusMessageIter *i, const char *property, void *data) {
         Session *s = data;
-        bool b;
+        dbus_bool_t b;
 
         assert(i);
         assert(property);
@@ -159,13 +159,13 @@ static int bus_session_append_active(DBusMessageIter *i, const char *property, v
 
 static int bus_session_append_idle_hint(DBusMessageIter *i, const char *property, void *data) {
         Session *s = data;
-        bool b;
+        int b;
 
         assert(i);
         assert(property);
         assert(s);
 
-        b = session_get_idle_hint(s, NULL);
+        b = session_get_idle_hint(s, NULL) > 0;
         if (!dbus_message_iter_append_basic(i, DBUS_TYPE_BOOLEAN, &b))
                 return -ENOMEM;
 
index 623f2c9c24a044a7a659c5154c51643b3569af25..5926dcfbc7ab04e85e5968a67788be97182be009 100644 (file)
@@ -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;