summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2018-06-27 10:52:40 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-07-10 17:12:14 +0200
commitfa0ac8371f79e225e3577fa5b63f887f1bd7ad19 (patch)
tree31d816613a1f52058f735bb793f150ddf0ca2bf0
parentc5598bcfa19f3624a776f23c3bb54d0ff8d96cea (diff)
Make the require_api at the right step.
Also ConfigExec isn't needed to be at the outside of the init step as we don't need to call the dynapi Change-Id: Id4c4d063137f8afdc84fbc3cdcc37a964baa2a66 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
-rw-r--r--src/test-binding.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/test-binding.c b/src/test-binding.c
index 33a8807..641dfc4 100644
--- a/src/test-binding.c
+++ b/src/test-binding.c
@@ -63,10 +63,12 @@ static int CtrlLoadStaticVerbs(afb_dynapi *apiHandle, AFB_ApiVerbs *verbs) {
};
static int CtrlInitOneApi(AFB_ApiT apiHandle) {
- int err = 0;
- AFB_default = apiHandle; // hugely hack to make all V2 AFB_DEBUG to work in fileutils
+ // Hugely hack to make all V2 AFB_DEBUG to work in fileutils
+ AFB_default = apiHandle;
- return err;
+ CtlConfigT *ctrlConfig = afb_dynapi_get_userdata(apiHandle);
+
+ return CtlConfigExec(apiHandle, ctrlConfig);
}
// next generation dynamic API-V3 mode
@@ -155,11 +157,5 @@ int afbBindingVdyn(afb_dynapi *apiHandle) {
// create one API per config file (Pre-V3 return code ToBeChanged)
status = afb_dynapi_new_api(apiHandle, ctrlConfig->api, ctrlConfig->info, 1, CtrlLoadOneApi, ctrlConfig);
- err = CtlConfigExec(apiHandle, ctrlConfig);
- if(err) {
- AFB_ApiError(apiHandle, "Error at CtlConfigExec step");
- return err;
- }
-
return status;
}