aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2016-02-09 17:42:22 +0100
committerJosé Bollo <jose.bollo@iot.bzh>2016-02-09 17:42:22 +0100
commitbf650bc39188c86cec8a11097f2c341e3f1b54b1 (patch)
treef47a45118d71d540bf05d7026710f981739b6e59
parent9eeddada7a5481660ab1547dae89be3b470571e6 (diff)
utils-jbus: fix bug that blocked
Change-Id: Icabab6e070b4c4b8e1357b199daf995c47090ad3 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
-rw-r--r--src/utils-jbus.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/utils-jbus.c b/src/utils-jbus.c
index 7000009..67e3ce4 100644
--- a/src/utils-jbus.c
+++ b/src/utils-jbus.c
@@ -669,6 +669,7 @@ int jbus_dispatch_multiple(struct jbus **jbuses, int njbuses, int maxcount)
for (i = r = 0 ; i < njbuses && r < maxcount ; i++) {
dbus_connection_read_write(jbuses[i]->connection, 0);
+ sts = dbus_connection_get_dispatch_status(jbuses[i]->connection);
while(sts == DBUS_DISPATCH_DATA_REMAINS && r < maxcount) {
sts = dbus_connection_dispatch(jbuses[i]->connection);
r++;
@@ -690,6 +691,8 @@ int jbus_read_write_dispatch_multiple(struct jbus **jbuses, int njbuses, int tom
assert(fds != NULL);
r = jbus_dispatch_multiple(jbuses, njbuses, maxcount);
+ if (r)
+ return r;
n = jbus_fill_pollfds(jbuses, njbuses, fds);
for(;;) {
s = poll(fds, n, toms);