Browse Source

failtest: handle EINTR from poll.

I don't quite know why, but this started happening to me.  We should
handle it anyway.
Rusty Russell 15 years ago
parent
commit
b0a59bdcb3
1 changed files with 6 additions and 1 deletions
  1. 6 1
      ccan/failtest/failtest.c

+ 6 - 1
ccan/failtest/failtest.c

@@ -483,8 +483,13 @@ static bool should_fail(struct failtest_call *call)
 		else
 			ret = poll(pfd, 2, failtest_timeout_ms);
 
-		if (ret <= 0)
+		if (ret == 0)
 			hand_down(SIGUSR1);
+		if (ret < 0) {
+			if (errno == EINTR)
+				continue;
+			err(1, "Poll returned %i", ret);
+		}
 
 		if (pfd[0].revents & POLLIN) {
 			ssize_t len;