From a60ff18d3c41af232cb5b93a35c90cd39a31301c Mon Sep 17 00:00:00 2001 From: Petar Kapris Date: Fri, 18 Dec 2020 15:18:45 +0100 Subject: [PATCH] Rearrange idle time checks in check_idle --- timeoutd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/timeoutd.c b/timeoutd.c index 1fd1a27..310c6f0 100644 --- a/timeoutd.c +++ b/timeoutd.c @@ -878,13 +878,13 @@ void check_idle() * current time less last modified time */ #ifdef TIMEOUTDX11 - if (chk_xsession(dev, host) && !chk_xterm(dev, host)) { /* check idle for Xsession, but not for xterm */ + if (chk_xterm(dev, host)) { + return; + } else if (chk_xsession(dev, host)) { /* check idle for Xsession, but not for xterm */ idle = get_xidle(user, host) / 1000 / 60; /* get_xidle returns millisecs, we need mins */ syslog(LOG_DEBUG, "get_xidle(%s,%s) returned %d mins idle for %s.", dev, host, (int) idle, user); - } else if (chk_xterm(dev, host)) - return; - else + } else #endif idle = (time_now - max(pstat->st_atime, pstat->st_mtime)) / 60;