diff options
author | Tiago Cunha <tcunha@gmx.com> | 2009-11-08 23:11:23 +0000 |
---|---|---|
committer | Tiago Cunha <tcunha@gmx.com> | 2009-11-08 23:11:23 +0000 |
commit | 02438c01b72f0cf1c22d45d84d7dea808cc548d1 (patch) | |
tree | ac8f7e4ee9d8fa56b3d0de4e9c15835fca52d41b /server-fn.c | |
parent | bee17719d8212fa3ff87b4059727849bd3c807b2 (diff) | |
download | rtmux-02438c01b72f0cf1c22d45d84d7dea808cc548d1.tar.gz rtmux-02438c01b72f0cf1c22d45d84d7dea808cc548d1.tar.bz2 rtmux-02438c01b72f0cf1c22d45d84d7dea808cc548d1.zip |
Sync OpenBSD patchset 504:
Use timeout events for the identify and message timers.
Diffstat (limited to 'server-fn.c')
-rw-r--r-- | server-fn.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/server-fn.c b/server-fn.c index 6dc810a2..4684ac8c 100644 --- a/server-fn.c +++ b/server-fn.c @@ -1,4 +1,4 @@ -/* $Id: server-fn.c,v 1.95 2009-11-08 23:09:36 tcunha Exp $ */ +/* $Id: server-fn.c,v 1.96 2009-11-08 23:11:23 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -24,6 +24,8 @@ #include "tmux.h" +void server_callback_identify(int, short, void *); + void server_fill_environ(struct session *s, struct environ *env) { @@ -353,10 +355,10 @@ server_set_identify(struct client *c) delay = options_get_number(&c->session->options, "display-panes-time"); tv.tv_sec = delay / 1000; tv.tv_usec = (delay % 1000) * 1000L; - - if (gettimeofday(&c->identify_timer, NULL) != 0) - fatal("gettimeofday failed"); - timeradd(&c->identify_timer, &tv, &c->identify_timer); + + evtimer_del(&c->identify_timer); + evtimer_set(&c->identify_timer, server_callback_identify, c); + evtimer_add(&c->identify_timer, &tv); c->flags |= CLIENT_IDENTIFY; c->tty.flags |= (TTY_FREEZE|TTY_NOCURSOR); @@ -374,6 +376,14 @@ server_clear_identify(struct client *c) } void +server_callback_identify(unused int fd, unused short events, void *data) +{ + struct client *c = data; + + server_clear_identify(c); +} + +void server_update_event(struct client *c) { short events; |