From e2d15a2bcb78dba323c4a807543fcc0cb1b03ef0 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 5 Feb 2018 10:01:51 +1030 Subject: [PATCH] io: don't fail if we get a signal. Signed-off-by: Rusty Russell --- ccan/io/poll.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ccan/io/poll.c b/ccan/io/poll.c index 3354abe0..b005a97e 100644 --- a/ccan/io/poll.c +++ b/ccan/io/poll.c @@ -280,8 +280,13 @@ void *io_loop(struct timers *timers, struct timer **expired) } r = pollfn(pollfds, num_fds, ms_timeout); - if (r < 0) + if (r < 0) { + /* Signals shouldn't break us, unless they set + * io_loop_return. */ + if (errno == EINTR) + continue; break; + } for (i = 0; i < num_fds && !io_loop_return; i++) { struct io_conn *c = (void *)fds[i]; -- 2.39.2