summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/login/logind-seat.c2
-rw-r--r--src/login/logind-session.c6
2 files changed, 3 insertions, 5 deletions
diff --git a/src/login/logind-seat.c b/src/login/logind-seat.c
index c2cf6e5e13..0ae0c520e6 100644
--- a/src/login/logind-seat.c
+++ b/src/login/logind-seat.c
@@ -471,7 +471,7 @@ int seat_get_idle_hint(Seat *s, dual_timestamp *t) {
if (!ih) {
if (!idle_hint) {
- if (k.monotonic < ts.monotonic)
+ if (k.monotonic > ts.monotonic)
ts = k;
} else {
idle_hint = false;
diff --git a/src/login/logind-session.c b/src/login/logind-session.c
index 9740e23a16..f670db853c 100644
--- a/src/login/logind-session.c
+++ b/src/login/logind-session.c
@@ -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)