summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/server-client.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2009-11-04 21:47:43 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2009-11-04 21:47:43 +0000
commit61f1e016a392ec594bd75c723836afda9e8af879 (patch)
tree9e4a33bd9e94ea82a64f94ea857ccda80f47e47a /usr.bin/tmux/server-client.c
parent4a10595dee0afa24fc6f3744ea05adc59019ae4e (diff)
Switch tty fds over to a bufferevent.
Diffstat (limited to 'usr.bin/tmux/server-client.c')
-rw-r--r--usr.bin/tmux/server-client.c25
1 files changed, 2 insertions, 23 deletions
diff --git a/usr.bin/tmux/server-client.c b/usr.bin/tmux/server-client.c
index a2a6b495434..61c85367180 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.12 2009/11/04 20:50:11 nicm Exp $ */
+/* $OpenBSD: server-client.c,v 1.13 2009/11/04 21:47:42 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -136,8 +136,7 @@ server_client_lost(struct client *c)
close(c->ibuf.fd);
imsg_clear(&c->ibuf);
event_del(&c->event);
- event_del(&c->tty.event);
-
+
for (i = 0; i < ARRAY_LENGTH(&dead_clients); i++) {
if (ARRAY_ITEM(&dead_clients, i) == NULL) {
ARRAY_SET(&dead_clients, i, c);
@@ -172,18 +171,6 @@ server_client_prepare(void)
event_set(&c->event,
c->ibuf.fd, events, server_client_callback, c);
event_add(&c->event, NULL);
-
- if (c->tty.fd == -1)
- continue;
- if (c->flags & CLIENT_SUSPENDED || c->session == NULL)
- continue;
- events = EV_READ;
- if (BUFFER_USED(c->tty.out) > 0)
- events |= EV_WRITE;
- event_del(&c->tty.event);
- event_set(&c->tty.event,
- c->tty.fd, events, server_client_callback, c);
- event_add(&c->tty.event, NULL);
}
}
@@ -209,14 +196,6 @@ server_client_callback(int fd, short events, void *data)
if (events & EV_READ && server_client_msg_dispatch(c) != 0)
goto client_lost;
}
-
- if (c->tty.fd != -1 && fd == c->tty.fd) {
- if (c->flags & CLIENT_SUSPENDED || c->session == NULL)
- return;
-
- if (buffer_poll(fd, events, c->tty.in, c->tty.out) != 0)
- goto client_lost;
- }
return;