diff options
author | José Bollo <jose.bollo@iot.bzh> | 2016-01-27 21:21:55 +0100 |
---|---|---|
committer | José Bollo <jose.bollo@iot.bzh> | 2016-02-04 15:47:01 +0100 |
commit | 47eab04cb98996403fc0e3d33d867399404268b1 (patch) | |
tree | 1a227599835b5360ce9336632afbe1324fe06e32 | |
parent | da2824b15151f3fcecb43a42db08d1875bd30558 (diff) |
utils-jbus: handles EINTR
Change-Id: If89cc876dee54f21402cd7989ca43d0d91dd8f92
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
-rw-r--r-- | src/utils-jbus.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/utils-jbus.c b/src/utils-jbus.c index 1f85a4c..7000009 100644 --- a/src/utils-jbus.c +++ b/src/utils-jbus.c @@ -691,9 +691,14 @@ int jbus_read_write_dispatch_multiple(struct jbus **jbuses, int njbuses, int tom r = jbus_dispatch_multiple(jbuses, njbuses, maxcount); n = jbus_fill_pollfds(jbuses, njbuses, fds); - s = poll(fds, n, toms); - if (s < 0) - return r ? r : s; + for(;;) { + s = poll(fds, n, toms); + if (s >= 0) + break; + if (errno != EINTR) + return r ? r : s; + toms = 0; + } n = jbus_dispatch_pollfds(jbuses, njbuses, fds, maxcount - r); return n >= 0 ? r + n : r ? r : n; } |