summaryrefslogtreecommitdiffstats
path: root/lib/waiter
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2013-08-19 11:58:23 +0800
committerJeremy Kerr <jk@ozlabs.org>2013-08-19 13:27:59 +0800
commitc7e26c27c7e029e6670dfebc8f27d9295e9fdeb7 (patch)
tree2225119e0c21e6ddc96658b342dcacf4aed13258 /lib/waiter
parente52a8c61a640ab4fce0b4caaa796ae3e1c4ff8a3 (diff)
downloadpetitboot-c7e26c27c7e029e6670dfebc8f27d9295e9fdeb7.zip
petitboot-c7e26c27c7e029e6670dfebc8f27d9295e9fdeb7.tar.gz
lib/waiter: handle -EINTR
Now that we're handing non-fatal signals (i.e., SIGCHLD in the process lib), we need to gracefully handle -EINTR from poll(). Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'lib/waiter')
-rw-r--r--lib/waiter/waiter.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/waiter/waiter.c b/lib/waiter/waiter.c
index e201ad1..d684348 100644
--- a/lib/waiter/waiter.c
+++ b/lib/waiter/waiter.c
@@ -3,6 +3,7 @@
#include <stdbool.h>
#include <string.h>
#include <assert.h>
+#include <errno.h>
#include <sys/time.h>
#include <talloc/talloc.h>
@@ -222,11 +223,13 @@ int waiter_poll(struct waitset *set)
timeout_ms = -1;
}
-
rc = poll(set->pollfds, set->n_io_waiters, timeout_ms);
- if (rc < 0)
+ if (rc < 0) {
+ if (errno == EINTR)
+ rc = 0;
goto out;
+ }
for (i = 0; i < set->n_io_waiters; i++) {
struct waiter *waiter = set->io_waiters[i];
OpenPOWER on IntegriCloud