summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/server-client.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2015-08-28 13:01:03 +0000
committernicm <nicm@openbsd.org>2015-08-28 13:01:03 +0000
commit09082c6882ac2642f0a6a2694070db57ee304ea5 (patch)
tree618b92cea6d0a206e8c24ebaa1a1e955011daacd /usr.bin/tmux/server-client.c
parentRemove the lock-server option which is a bit redundant, it isn't that (diff)
downloadwireguard-openbsd-09082c6882ac2642f0a6a2694070db57ee304ea5.tar.xz
wireguard-openbsd-09082c6882ac2642f0a6a2694070db57ee304ea5.zip
Make session_update_activity more useful and use it in more places.
Diffstat (limited to 'usr.bin/tmux/server-client.c')
-rw-r--r--usr.bin/tmux/server-client.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.bin/tmux/server-client.c b/usr.bin/tmux/server-client.c
index 93d19c61fa3..733cbe7eca5 100644
--- a/usr.bin/tmux/server-client.c
+++ b/usr.bin/tmux/server-client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server-client.c,v 1.148 2015/08/28 12:16:28 nicm Exp $ */
+/* $OpenBSD: server-client.c,v 1.149 2015/08/28 13:01:03 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -561,9 +561,7 @@ server_client_handle_key(struct client *c, int key)
/* Update the activity timer. */
if (gettimeofday(&c->activity_time, NULL) != 0)
fatal("gettimeofday failed");
- memcpy(&s->last_activity_time, &s->activity_time,
- sizeof s->last_activity_time);
- memcpy(&s->activity_time, &c->activity_time, sizeof s->activity_time);
+ session_update_activity(s, &c->activity_time);
/* Number keys jump to pane in identify mode. */
if (c->flags & CLIENT_IDENTIFY && key >= '0' && key <= '9') {
@@ -981,6 +979,7 @@ server_client_msg_dispatch(struct client *c)
struct msg_stdin_data stdindata;
const char *data;
ssize_t n, datalen;
+ struct session *s;
if ((n = imsg_read(&c->ibuf)) == -1 || n == 0)
return (-1);
@@ -1064,11 +1063,12 @@ server_client_msg_dispatch(struct client *c)
if (c->tty.fd == -1) /* exited in the meantime */
break;
+ s = c->session;
if (gettimeofday(&c->activity_time, NULL) != 0)
fatal("gettimeofday");
- if (c->session != NULL)
- session_update_activity(c->session);
+ if (s != NULL)
+ session_update_activity(s, &c->activity_time);
tty_start_tty(&c->tty);
server_redraw_client(c);