summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2011-03-25 11:46:17 +1030
committerRusty Russell <rusty@rustcorp.com.au>2011-03-25 11:46:17 +1030
commitb0a59bdcb3356eec66015bcdffd9a3fbaef0489a (patch)
tree4596f7f895b4ed642030e5b2cc659d7f1bb61ee9
parent94b797a5d4fb35f85a314e11c9ded9f18b941d00 (diff)
failtest: handle EINTR from poll.
I don't quite know why, but this started happening to me. We should handle it anyway.
-rw-r--r--ccan/failtest/failtest.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ccan/failtest/failtest.c b/ccan/failtest/failtest.c
index 0f2ab0c7..7a6f5220 100644
--- a/ccan/failtest/failtest.c
+++ b/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;