aboutsummaryrefslogtreecommitdiff
path: root/server.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2009-10-05 18:30:54 +0000
committerNicholas Marriott <nicm@openbsd.org>2009-10-05 18:30:54 +0000
commit4ca2200d838732c129c6dd5c11f92245346a1e28 (patch)
tree44096997d5b3b2d20ef12f24f37a627a99a5e747 /server.c
parent45043ebf3ecabb8847d404baa7b3e9d66696f667 (diff)
downloadrtmux-4ca2200d838732c129c6dd5c11f92245346a1e28.tar.gz
rtmux-4ca2200d838732c129c6dd5c11f92245346a1e28.tar.bz2
rtmux-4ca2200d838732c129c6dd5c11f92245346a1e28.zip
If no target client is specified to commands which accept one, try to guess the
current client, in a similar manner to how sessions already work: if the current session can be established and has only one client, use that; otherwise use the most recently created client.
Diffstat (limited to 'server.c')
-rw-r--r--server.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/server.c b/server.c
index f7136784..b192cace 100644
--- a/server.c
+++ b/server.c
@@ -90,6 +90,9 @@ server_create_client(int fd)
c = xcalloc(1, sizeof *c);
c->references = 0;
imsg_init(&c->ibuf, fd);
+
+ if (gettimeofday(&c->tv, NULL) != 0)
+ fatal("gettimeofday failed");
ARRAY_INIT(&c->prompt_hdata);