chiark / gitweb /
logind: redefine idleness to start at last activity
[elogind.git] / src / login / logind-session.c
index 9740e23a1670f2556455ced06148dddc3de5e8fc..f670db853c9e65709ab6b420c8b2c34c013b7cc0 100644 (file)
@@ -738,7 +738,6 @@ int session_get_idle_hint(Session *s, dual_timestamp *t) {
         char *p;
         struct stat st;
         usec_t u, n;
-        bool b;
         int k;
 
         assert(s);
@@ -773,12 +772,11 @@ int session_get_idle_hint(Session *s, dual_timestamp *t) {
 
         u = timespec_load(&st.st_atim);
         n = now(CLOCK_REALTIME);
-        b = u + IDLE_THRESHOLD_USEC < n;
 
         if (t)
-                dual_timestamp_from_realtime(t, u + b*IDLE_THRESHOLD_USEC);
+                dual_timestamp_from_realtime(t, u);
 
-        return b;
+        return u + IDLE_THRESHOLD_USEC < n;
 
 dont_know:
         if (t)