summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/server.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2015-06-05 18:01:12 +0000
committernicm <nicm@openbsd.org>2015-06-05 18:01:12 +0000
commit629b6251a086286bb3aa5f2f4f529a33980d28a7 (patch)
tree2367d67d5beb673eabd4c1833f557c541208548e /usr.bin/tmux/server.c
parentDo not unconditionally clear pcb_onfault after a uvm_fault. That will (diff)
downloadwireguard-openbsd-629b6251a086286bb3aa5f2f4f529a33980d28a7.tar.xz
wireguard-openbsd-629b6251a086286bb3aa5f2f4f529a33980d28a7.zip
Instead of putting dead clients on a list and checking it every loop,
use event_once to queue a callback to deal with them. Also dead clients with references would never actually be freed because the wrap-up functions (the callback for stdin, or status_prompt_clear) would never be called. So call them in server_client_lost.
Diffstat (limited to 'usr.bin/tmux/server.c')
-rw-r--r--usr.bin/tmux/server.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/usr.bin/tmux/server.c b/usr.bin/tmux/server.c
index 98cecda9379..4f157fdc175 100644
--- a/usr.bin/tmux/server.c
+++ b/usr.bin/tmux/server.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server.c,v 1.126 2015/06/04 11:43:51 nicm Exp $ */
+/* $OpenBSD: server.c,v 1.127 2015/06/05 18:01:12 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -41,9 +41,7 @@
* Main server functions.
*/
-/* Client list. */
struct clients clients;
-struct clients dead_clients;
int server_fd;
int server_shutdown;
@@ -205,7 +203,6 @@ server_start(int lockfd, char *lockfile)
RB_INIT(&windows);
RB_INIT(&all_window_panes);
TAILQ_INIT(&clients);
- TAILQ_INIT(&dead_clients);
RB_INIT(&sessions);
RB_INIT(&dead_sessions);
TAILQ_INIT(&session_groups);
@@ -325,7 +322,6 @@ void
server_clean_dead(void)
{
struct session *s, *s1;
- struct client *c, *c1;
RB_FOREACH_SAFE(s, sessions, &dead_sessions, s1) {
if (s->references != 0)
@@ -334,13 +330,6 @@ server_clean_dead(void)
free(s->name);
free(s);
}
-
- TAILQ_FOREACH_SAFE(c, &dead_clients, entry, c1) {
- if (c->references != 0)
- continue;
- TAILQ_REMOVE(&dead_clients, c, entry);
- free(c);
- }
}
/* Update socket execute permissions based on whether sessions are attached. */