An EOF is a good reason to close a connection.
authorkrw <krw@openbsd.org>
Sun, 13 Jul 2014 20:51:08 +0000 (20:51 +0000)
committerkrw <krw@openbsd.org>
Sun, 13 Jul 2014 20:51:08 +0000 (20:51 +0000)
ok nicm@

usr.bin/tmux/client.c
usr.bin/tmux/server-client.c

index dda8e39..ce2d68e 100644 (file)
@@ -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 <nicm@users.sourceforge.net>
@@ -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;
        }
 
index 856df3d..5876b21 100644 (file)
@@ -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 <nicm@users.sourceforge.net>
@@ -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;