diff options
author | Simon Rettberg | 2019-11-13 13:40:21 +0100 |
---|---|---|
committer | Simon Rettberg | 2019-11-13 13:40:21 +0100 |
commit | 46ab17fb79b74d5a6b5b1e3aea9d2d3fd0b56482 (patch) | |
tree | 1b61d69f4ad216db745285cf17478f0891f4d86e | |
parent | Handle duplicate entries in utmp for X sessions (diff) | |
download | idle-daemon-46ab17fb79b74d5a6b5b1e3aea9d2d3fd0b56482.tar.gz idle-daemon-46ab17fb79b74d5a6b5b1e3aea9d2d3fd0b56482.tar.xz idle-daemon-46ab17fb79b74d5a6b5b1e3aea9d2d3fd0b56482.zip |
Show idle time in RPC reply
-rw-r--r-- | src/rpc.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -178,8 +178,9 @@ static void handleClient( int fd, struct ucred *creds ) if ( user != NULL ) { fprintf( s, "[%s]\n" "logoutTime=%lld\n" - "locked=%d\n", - tok, (long long)user->logoutTime, (int)user->isLocked ); + "locked=%d\n" + "idleSeconds=%d\n", + tok, (long long)user->logoutTime, (int)user->isLocked, (int)( time(NULL) - user->lastActivity ) ); } tok = strtok( NULL, " \t\n\r" ); } |