summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/server.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2009-11-03 20:29:47 +0000
committernicm <nicm@openbsd.org>2009-11-03 20:29:47 +0000
commita18122f87d1be1bb6c3e4edde905492843e55c90 (patch)
tree5db7be6eee6a80e0e8faba0234d3f632e4cc6dee /usr.bin/tmux/server.c
parent- remove a useless member of struct cond (diff)
downloadwireguard-openbsd-a18122f87d1be1bb6c3e4edde905492843e55c90.tar.xz
wireguard-openbsd-a18122f87d1be1bb6c3e4edde905492843e55c90.zip
Change session and client activity and creation time members to have more
meaningful names. Also, remove the code to try and update the session activity time for the command client when a command message is received as is pointless because it des not have a session.
Diffstat (limited to 'usr.bin/tmux/server.c')
-rw-r--r--usr.bin/tmux/server.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/usr.bin/tmux/server.c b/usr.bin/tmux/server.c
index 19d795b7c5d..e20c9df9a00 100644
--- a/usr.bin/tmux/server.c
+++ b/usr.bin/tmux/server.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server.c,v 1.64 2009/11/02 12:48:44 nicm Exp $ */
+/* $OpenBSD: server.c,v 1.65 2009/11/03 20:29:47 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -565,12 +565,13 @@ server_lock_server(void)
continue;
if (s->flags & SESSION_UNATTACHED) {
- s->activity = time(NULL);
+ if (gettimeofday(&s->activity_time, NULL) != 0)
+ fatal("gettimeofday failed");
continue;
}
timeout = options_get_number(&s->options, "lock-after-time");
- if (timeout <= 0 || t <= s->activity + timeout)
+ if (timeout <= 0 || t <= s->activity_time.tv_sec + timeout)
return; /* not timed out */
}
@@ -593,12 +594,13 @@ server_lock_sessions(void)
continue;
if (s->flags & SESSION_UNATTACHED) {
- s->activity = time(NULL);
+ if (gettimeofday(&s->activity_time, NULL) != 0)
+ fatal("gettimeofday failed");
continue;
}
timeout = options_get_number(&s->options, "lock-after-time");
- if (timeout > 0 && t > s->activity + timeout) {
+ if (timeout > 0 && t > s->activity_time.tv_sec + timeout) {
server_lock_session(s);
recalculate_sizes();
}