chiark / gitweb /
login: check return value of session_get_idle_hint
authorVáclav Pavlín <vpavlin@redhat.com>
Fri, 21 Sep 2012 11:38:40 +0000 (13:38 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 21 Sep 2012 14:08:54 +0000 (16:08 +0200)
src/login/logind-session-dbus.c

index 9103781..2e7bfe0 100644 (file)
@@ -183,12 +183,16 @@ static int bus_session_append_idle_hint_since(DBusMessageIter *i, const char *pr
         Session *s = data;
         dual_timestamp t;
         uint64_t u;
+        int r;
 
         assert(i);
         assert(property);
         assert(s);
 
-        session_get_idle_hint(s, &t);
+        r = session_get_idle_hint(s, &t);
+        if (r < 0)
+                return r;
+
         u = streq(property, "IdleSinceHint") ? t.realtime : t.monotonic;
 
         if (!dbus_message_iter_append_basic(i, DBUS_TYPE_UINT64, &u))