summaryrefslogtreecommitdiffstats
path: root/ctl-lib/ctl-config.c
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2018-06-11 22:48:10 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-12-13 15:02:55 +0100
commitadae037d59caf7159803b8bc90ddcb5ab29a7af6 (patch)
tree68ba1f651fa79c045a022f39604d2e12d90c3a62 /ctl-lib/ctl-config.c
parent837ab3e4cfb9844dafe1b125a42f77153ec52b3a (diff)
Fixed hidden bound variable (apiHandle)
Change-Id: Id4c3e0eb9f770c78b38d8650e6a89577851984f9 Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
Diffstat (limited to 'ctl-lib/ctl-config.c')
-rw-r--r--ctl-lib/ctl-config.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/ctl-lib/ctl-config.c b/ctl-lib/ctl-config.c
index cfa0963..8ef9a85 100644
--- a/ctl-lib/ctl-config.c
+++ b/ctl-lib/ctl-config.c
@@ -104,25 +104,25 @@ char* CtlConfigSearch(AFB_ApiT apiHandle, const char *dirList, const char *prefi
return NULL;
}
+static void DispatchRequireOneApi(AFB_ApiT apiHandle, json_object * bindindJ) {
+ const char* requireBinding = json_object_get_string(bindindJ);
+ int err = AFB_RequireApi(apiHandle, requireBinding, 1);
+ if (err) {
+ AFB_ApiWarning(apiHandle, "CTL-LOAD-CONFIG:REQUIRE Fail to get=%s", requireBinding);
+ }
+}
+
int CtlConfigExec(AFB_ApiT apiHandle, CtlConfigT *ctlConfig) {
// best effort to initialise everything before starting
if (ctlConfig->requireJ) {
- void DispatchRequireOneApi(json_object * bindindJ) {
- const char* requireBinding = json_object_get_string(bindindJ);
- int err = AFB_RequireApi(apiHandle, requireBinding, 1);
- if (err) {
- AFB_ApiWarning(apiHandle, "CTL-LOAD-CONFIG:REQUIRE Fail to get=%s", requireBinding);
- }
- }
-
if (json_object_get_type(ctlConfig->requireJ) == json_type_array) {
for (int idx = 0; idx < json_object_array_length(ctlConfig->requireJ); idx++) {
- DispatchRequireOneApi(json_object_array_get_idx(ctlConfig->requireJ, idx));
+ DispatchRequireOneApi(apiHandle, json_object_array_get_idx(ctlConfig->requireJ, idx));
}
} else {
- DispatchRequireOneApi(ctlConfig->requireJ);
+ DispatchRequireOneApi(apiHandle, ctlConfig->requireJ);
}
}