diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2009-08-11 22:34:18 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2009-08-11 22:34:18 +0000 |
commit | 28ccaae4568fd043b505ea458f70f5960aa442cb (patch) | |
tree | 83e7a26d3d573243d7ae8aa80dfd1901e60a9c81 /usr.bin/tmux | |
parent | e997d8c0270e98dc081ec35fd3b27a142181bb35 (diff) |
Initialise log_fd to -1, prevents spurious disconnection of the client when it
ends up as fd 0 (likely if the server is started with "tmux start").
Also add some extra debugging messages to server.c.
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r-- | usr.bin/tmux/server.c | 5 | ||||
-rw-r--r-- | usr.bin/tmux/tty.c | 3 |
2 files changed, 6 insertions, 2 deletions
diff --git a/usr.bin/tmux/server.c b/usr.bin/tmux/server.c index c9e79389f6b..1af4027129d 100644 --- a/usr.bin/tmux/server.c +++ b/usr.bin/tmux/server.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server.c,v 1.19 2009/08/11 19:32:25 nicm Exp $ */ +/* $OpenBSD: server.c,v 1.20 2009/08/11 22:34:17 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -110,6 +110,7 @@ server_create_client(int fd) } } ARRAY_ADD(&clients, c); + log_debug("new client %d", fd); } /* Find client index. */ @@ -257,6 +258,7 @@ server_main(int srv_fd) time_t now, last; siginit(); + log_debug("server socket is %d", srv_fd); last = time(NULL); @@ -901,6 +903,7 @@ server_lost_client(struct client *c) if (ARRAY_ITEM(&clients, i) == c) ARRAY_SET(&clients, i, NULL); } + log_debug("lost client %d", c->ibuf.fd); tty_free(&c->tty); diff --git a/usr.bin/tmux/tty.c b/usr.bin/tmux/tty.c index 0c9bbe40604..a9dd2251181 100644 --- a/usr.bin/tmux/tty.c +++ b/usr.bin/tmux/tty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty.c,v 1.22 2009/08/11 21:28:11 nicm Exp $ */ +/* $OpenBSD: tty.c,v 1.23 2009/08/11 22:34:17 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -49,6 +49,7 @@ tty_init(struct tty *tty, int fd, char *path, char *term) { tty->path = xstrdup(path); tty->fd = fd; + tty->log_fd = -1; if (term == NULL || *term == '\0') tty->termname = xstrdup("unknown"); |