From 306b6b0e89957bc1f2faa0a9b30a8398d1f40dfc Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 14 Oct 2013 21:32:58 +1030 Subject: [PATCH] ccan/io: handle errors on poll() Without this, closing an fd results in a spin... Signed-off-by: Rusty Russell --- ccan/io/poll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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()); -- 2.39.2