diff options
author | Sebastian Benoit <benno@cvs.openbsd.org> | 2013-11-13 20:43:38 +0000 |
---|---|---|
committer | Sebastian Benoit <benno@cvs.openbsd.org> | 2013-11-13 20:43:38 +0000 |
commit | cd03313ec3ea86b84cb37afe42694cdc283c4c12 (patch) | |
tree | 35fc1dd08f1b29b3a1e978cf011f62fbe6949bf8 /usr.bin | |
parent | fb9e9cba60b5f6df07638c05a083213470d08fb2 (diff) |
from nicm: : handle msgbuf_write() returning EAGAIN
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/tmux/client.c | 4 | ||||
-rw-r--r-- | usr.bin/tmux/server-client.c | 6 |
2 files changed, 6 insertions, 4 deletions
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 <nicm@users.sourceforge.net> @@ -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 <nicm@users.sourceforge.net> @@ -19,6 +19,7 @@ #include <sys/types.h> #include <sys/ioctl.h> +#include <errno.h> #include <event.h> #include <fcntl.h> #include <paths.h> @@ -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) { |