sdbus client: Add proper error handling for ENOENT
Prior, a server error causes the client to hang rather than exit.
Change-Id: I34533358df6227798b970f1214b574b6e5bcec47
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/libmapper/mapper.c b/libmapper/mapper.c
index a2bb97a..b1aec6b 100644
--- a/libmapper/mapper.c
+++ b/libmapper/mapper.c
@@ -157,6 +157,9 @@
goto exit;
r = sd_bus_message_get_errno(m);
+ if(r == ENOENT)
+ goto exit;
+
if(r == EBUSY && data->retry < mapper_busy_retries) {
r = sd_event_now(wait->loop,
CLOCK_MONOTONIC,
@@ -182,14 +185,11 @@
return 0;
}
- if(r == EBUSY) {
+ if(r) {
async_wait_done(-r, wait);
goto exit;
}
- if(r) // not found
- goto exit;
-
for(i=0; i<wait->count; ++i) {
if(!strcmp(data->path, wait->objs[i])) {
wait->status[i] = 1;