summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSimon Rettberg2020-10-13 10:23:19 +0200
committerSimon Rettberg2020-10-13 10:23:19 +0200
commit21cca5a6f6c1c8c3c09842f78c2c5a7ffdecf9e6 (patch)
treea6ae3fb530afa8fe3a1ff81a816ece61ec408544 /src
parentAdd usercount to RPC, simplify timing calculation (diff)
downloadidle-daemon-21cca5a6f6c1c8c3c09842f78c2c5a7ffdecf9e6.tar.gz
idle-daemon-21cca5a6f6c1c8c3c09842f78c2c5a7ffdecf9e6.tar.xz
idle-daemon-21cca5a6f6c1c8c3c09842f78c2c5a7ffdecf9e6.zip
Fix sleep time calculation for logout timeout as well
Diffstat (limited to 'src')
-rw-r--r--src/main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index a29fd35..316aec5 100644
--- a/src/main.c
+++ b/src/main.c
@@ -206,9 +206,9 @@ int main( int argc, char **argv )
if ( remaining % 30 < 10 ) {
warn_showDefaultWarning( usr, WARN_LOGOUT_LOW, remaining );
}
- CAP_SLEEP( remaining - ( ( remaining - 30 ) / 60 * 60 + 2 ) );
+ CAP_SLEEP( ( remaining % 30 ) - 2 );
} else {
- CAP_SLEEP( remaining - 299 );
+ CAP_SLEEP( remaining - 305 );
}
usr->logoutTime = NOW + remaining;
}