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-07-09 17:47:25 +0200
commit4a72073d15248dbb3c9d88377405ad44e75f6d1b (patch)
tree3db5636c014b689dd2e20a16a5df123bdcab1ea0 /ctl-lib/ctl-plugin.c
parente45d063fb5b4c45d92eb74df985075813e3b71a4 (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;
}