summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/server.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/tmux/server.c')
-rw-r--r--usr.bin/tmux/server.c47
1 files changed, 3 insertions, 44 deletions
diff --git a/usr.bin/tmux/server.c b/usr.bin/tmux/server.c
index 83ff9513135..787b334d27e 100644
--- a/usr.bin/tmux/server.c
+++ b/usr.bin/tmux/server.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server.c,v 1.133 2015/08/28 12:31:55 nicm Exp $ */
+/* $OpenBSD: server.c,v 1.134 2015/08/28 13:12:20 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -46,7 +46,6 @@ struct clients clients;
int server_fd;
int server_shutdown;
struct event server_ev_accept;
-struct event server_ev_second;
struct session *marked_session;
struct winlink *marked_winlink;
@@ -163,9 +162,8 @@ server_create_socket(void)
int
server_start(int lockfd, char *lockfile)
{
- int pair[2];
- struct timeval tv;
- char *cause;
+ int pair[2];
+ char *cause;
/* The first client is special and gets a socketpair; create it. */
if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, pair) != 0)
@@ -243,11 +241,6 @@ server_start(int lockfd, char *lockfile)
server_add_accept(0);
- memset(&tv, 0, sizeof tv);
- tv.tv_sec = 1;
- evtimer_set(&server_ev_second, server_second_callback, NULL);
- evtimer_add(&server_ev_second, &tv);
-
set_signals(server_signal_callback);
server_loop();
status_prompt_save_history();
@@ -498,37 +491,3 @@ server_child_stopped(pid_t pid, int status)
}
}
}
-
-/* Handle once-per-second timer events. */
-void
-server_second_callback(unused int fd, unused short events, unused void *arg)
-{
- struct timeval tv;
-
- server_lock_sessions();
-
- evtimer_del(&server_ev_second);
- memset(&tv, 0, sizeof tv);
- tv.tv_sec = 1;
- evtimer_add(&server_ev_second, &tv);
-}
-
-/* Lock any sessions which have timed out. */
-void
-server_lock_sessions(void)
-{
- struct session *s;
- int timeout;
- time_t t;
-
- t = time(NULL);
- RB_FOREACH(s, sessions, &sessions) {
- if (s->flags & SESSION_UNATTACHED)
- continue;
- timeout = options_get_number(&s->options, "lock-after-time");
- if (timeout > 0 && t > s->activity_time.tv_sec + timeout) {
- server_lock_session(s);
- recalculate_sizes();
- }
- }
-}