From cd03313ec3ea86b84cb37afe42694cdc283c4c12 Mon Sep 17 00:00:00 2001 From: Sebastian Benoit Date: Wed, 13 Nov 2013 20:43:38 +0000 Subject: from nicm: : handle msgbuf_write() returning EAGAIN --- usr.bin/tmux/client.c | 4 ++-- usr.bin/tmux/server-client.c | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'usr.bin') diff --git a/usr.bin/tmux/client.c b/usr.bin/tmux/client.c index 6f05eb58262..db938a082fc 100644 --- a/usr.bin/tmux/client.c +++ b/usr.bin/tmux/client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: client.c,v 1.75 2013/10/10 12:35:30 nicm Exp $ */ +/* $OpenBSD: client.c,v 1.76 2013/11/13 20:43:36 benno Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -464,7 +464,7 @@ client_callback(unused int fd, short events, void *data) } if (events & EV_WRITE) { - if (msgbuf_write(&client_ibuf.w) < 0) + 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 c27dcdf48fe..16f30e552a2 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.113 2013/10/20 17:28:43 nicm Exp $ */ +/* $OpenBSD: server-client.c,v 1.114 2013/11/13 20:43:37 benno Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -19,6 +19,7 @@ #include #include +#include #include #include #include @@ -222,7 +223,8 @@ 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; if (c->flags & CLIENT_BAD) { -- cgit v1.2.3