diff options
author | Simon Rettberg | 2019-11-18 13:26:28 +0100 |
---|---|---|
committer | Simon Rettberg | 2019-11-18 13:26:28 +0100 |
commit | d352f73c2ffb079012ed16b455bb4dbeb3a43177 (patch) | |
tree | a02d544b45803ce12e011b823eed41021c7bfd0f | |
parent | Don't poll .no-saver if dpms and screen saver are disabled (diff) | |
download | idle-daemon-d352f73c2ffb079012ed16b455bb4dbeb3a43177.tar.gz idle-daemon-d352f73c2ffb079012ed16b455bb4dbeb3a43177.tar.xz idle-daemon-d352f73c2ffb079012ed16b455bb4dbeb3a43177.zip |
rpc: Account for wall clock changes
-rw-r--r-- | src/rpc.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -176,11 +176,12 @@ static void handleClient( int fd, struct ucred *creds ) while ( tok != NULL ) { struct user *user = main_getUser( tok ); if ( user != NULL ) { + const int idleTime = (int)( time( NULL ) - ( user->lastActivity + user->lastActivityOffset ) ); fprintf( s, "[%s]\n" "logoutTime=%lld\n" "locked=%d\n" "idleSeconds=%d\n", - tok, (long long)user->logoutTime, (int)user->isLocked, (int)( time(NULL) - user->lastActivity ) ); + tok, (long long)user->logoutTime, (int)user->isLocked, idleTime ); } tok = strtok( NULL, " \t\n\r" ); } |