Browse Source

ccan/io: handle errors on poll()

Without this, closing an fd results in a spin...

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Rusty Russell 12 years ago
parent
commit
306b6b0e89
1 changed files with 1 additions and 1 deletions
  1. 1 1
      ccan/io/poll.c

+ 1 - 1
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());