summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSimon Rettberg2019-11-13 13:40:21 +0100
committerSimon Rettberg2019-11-13 13:40:21 +0100
commit46ab17fb79b74d5a6b5b1e3aea9d2d3fd0b56482 (patch)
tree1b61d69f4ad216db745285cf17478f0891f4d86e /src
parentHandle duplicate entries in utmp for X sessions (diff)
downloadidle-daemon-46ab17fb79b74d5a6b5b1e3aea9d2d3fd0b56482.tar.gz
idle-daemon-46ab17fb79b74d5a6b5b1e3aea9d2d3fd0b56482.tar.xz
idle-daemon-46ab17fb79b74d5a6b5b1e3aea9d2d3fd0b56482.zip
Show idle time in RPC reply
Diffstat (limited to 'src')
-rw-r--r--src/rpc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/rpc.c b/src/rpc.c
index 33df75b..e63f7fe 100644
--- a/src/rpc.c
+++ b/src/rpc.c
@@ -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" );
}