summaryrefslogtreecommitdiffstats
path: root/ctl-lib/ctl-plugin.c
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2018-07-09 17:47:25 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-12-13 15:02:55 +0100
commit95d249caff27a1ad870a68075e7e9c9d155d9ab5 (patch)
tree3db5636c014b689dd2e20a16a5df123bdcab1ea0 /ctl-lib/ctl-plugin.c
parent551d1666b573802b429c7fccddc146ae3c950e9d (diff)
Fix: plugin api assignement order
There was an issue because the assignement happens after the onLoad call. Change-Id: I97dc65ad2a14a6e72bb2f59bc443d9fc5779abee Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'ctl-lib/ctl-plugin.c')
-rw-r--r--ctl-lib/ctl-plugin.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/ctl-lib/ctl-plugin.c b/ctl-lib/ctl-plugin.c
index f36c82c..16b2056 100644
--- a/ctl-lib/ctl-plugin.c
+++ b/ctl-lib/ctl-plugin.c
@@ -175,6 +175,7 @@ static int PluginLoadCOne(AFB_ApiT apiHandle, const char *pluginpath, json_objec
LuaL2cNewLib(ctlPlugin->ctlL2cFunc->l2cFunc, ctlPlugin->ctlL2cFunc->l2cCount, ctlPlugin->ctlL2cFunc->prefix);
}
#endif
+ ctlPlugin->api = apiHandle;
DispatchPluginInstallCbT ctlPluginOnload = dlsym(dlHandle, "CtlPluginOnload");
if (ctlPluginOnload) {
if((*ctlPluginOnload) (ctlPlugin, handle)) {
@@ -183,8 +184,6 @@ static int PluginLoadCOne(AFB_ApiT apiHandle, const char *pluginpath, json_objec
}
}
- ctlPlugin->api = apiHandle;
-
return 0;
}