From: krw Date: Sun, 13 Jul 2014 20:51:08 +0000 (+0000) Subject: An EOF is a good reason to close a connection. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=58f757b4681e97600b6d3459605951fe6fc7dacc;p=openbsd An EOF is a good reason to close a connection. ok nicm@ --- diff --git a/usr.bin/tmux/client.c b/usr.bin/tmux/client.c index dda8e39b3c6..ce2d68ed2f9 100644 --- a/usr.bin/tmux/client.c +++ b/usr.bin/tmux/client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: client.c,v 1.80 2014/04/29 22:31:22 nicm Exp $ */ +/* $OpenBSD: client.c,v 1.81 2014/07/13 20:51:08 krw Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -469,7 +469,7 @@ client_callback(unused int fd, short events, void *data) } if (events & EV_WRITE) { - if (msgbuf_write(&client_ibuf.w) < 0 && errno != EAGAIN) + if (msgbuf_write(&client_ibuf.w) <= 0 && errno != EAGAIN) goto lost_server; } diff --git a/usr.bin/tmux/server-client.c b/usr.bin/tmux/server-client.c index 856df3d3d1a..5876b2127e9 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.121 2014/07/13 20:23:10 nicm Exp $ */ +/* $OpenBSD: server-client.c,v 1.122 2014/07/13 20:51:08 krw Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -224,7 +224,7 @@ server_client_callback(int fd, short events, void *data) return; if (fd == c->ibuf.fd) { - if (events & EV_WRITE && msgbuf_write(&c->ibuf.w) < 0 && + if (events & EV_WRITE && msgbuf_write(&c->ibuf.w) <= 0 && errno != EAGAIN) goto client_lost;