afb-api-dyn: Uniform return 0 on success
authorJosé Bollo <jose.bollo@iot.bzh>
Mon, 16 Oct 2017 19:24:07 +0000 (21:24 +0200)
committerJosé Bollo <jose.bollo@iot.bzh>
Mon, 23 Oct 2017 11:00:32 +0000 (13:00 +0200)
Change-Id: I6ca079fa84547928f999e07d1925202a1e14850f
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
bindings/samples/ave.c
src/afb-api-dyn.c

index 6c3bf92..a4b4144 100644 (file)
@@ -484,6 +484,8 @@ int afbBindingVdyn(afb_dynapi *dynapi)
 
        for (i = 0; apis[i] ; i++) {
                rc = afb_dynapi_new_api(dynapi, apis[i], NULL, build_api, (void*)apis[i]);
+               if (rc < 0)
+                       AFB_DYNAPI_ERROR(dynapi, "can't create API %s", apis[i]);
        }
        return 0;
 }
index 571f7fa..0667f51 100644 (file)
@@ -274,7 +274,7 @@ int afb_api_dyn_add(struct afb_apiset *apiset, const char *name, const char *inf
                goto error;
        }
        INFO("binding %s added to set %s", afb_export_apiname(dynapi->export), afb_apiset_name(apiset));
-       return 1;
+       return 0;
 
 error:
        afb_export_destroy(export);