From: Rusty Russell Date: Mon, 14 Oct 2013 11:02:58 +0000 (+1030) Subject: ccan/io: handle errors on poll() X-Git-Url: http://git.ozlabs.org/?p=ccan;a=commitdiff_plain;h=306b6b0e89957bc1f2faa0a9b30a8398d1f40dfc ccan/io: handle errors on poll() Without this, closing an fd results in a spin... Signed-off-by: Rusty Russell --- diff --git a/ccan/io/poll.c b/ccan/io/poll.c index 06e3b591..42ed67ad 100644 --- a/ccan/io/poll.c +++ b/ccan/io/poll.c @@ -338,7 +338,7 @@ void *io_loop(void) /* debug can recurse; anything can change. */ if (doing_debug()) break; - } else if (events & POLLHUP) { + } else if (events & (POLLHUP|POLLNVAL|POLLERR)) { r--; set_current(c); set_plan(c, io_close());