aboutsummaryrefslogtreecommitdiffstats
path: root/ctl-lib/ctl-config.c
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2018-05-09 12:58:40 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-12-13 15:02:54 +0100
commit814f0146fc27a7f3369ff658d477f9357befa60a (patch)
treef625bfdfdaaff2e6643d4fa4285bc707a6116110 /ctl-lib/ctl-config.c
parentc8676f0ef8f2e6eb8a21fd31541bbe7a611c8e45 (diff)
Use new version of function GetBindingDirPath
That follow the last update in afb-helpers submodule used. Change-Id: Ia6149ae96c1591f3d0791f4263e8beafbe6e764d Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'ctl-lib/ctl-config.c')
-rw-r--r--ctl-lib/ctl-config.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/ctl-lib/ctl-config.c b/ctl-lib/ctl-config.c
index 8dc06fa..2637188 100644
--- a/ctl-lib/ctl-config.c
+++ b/ctl-lib/ctl-config.c
@@ -165,6 +165,7 @@ json_object* LoadAdditionalsFiles(AFB_ApiT apiHandle, CtlConfigT *ctlHandle, con
json_object* CtlUpdateSectionConfig(AFB_ApiT apiHandle, CtlConfigT *ctlHandle, const char *key, json_object *sectionJ, json_object *filesJ) {
json_object *sectionArrayJ;
+ const char *bindingPath = GetBindingDirPath(apiHandle);
if(! json_object_is_type(sectionJ, json_type_array)) {
sectionArrayJ = json_object_new_array();
@@ -183,9 +184,9 @@ json_object* CtlUpdateSectionConfig(AFB_ApiT apiHandle, CtlConfigT *ctlHandle, c
json_object *oneFileJ = json_object_array_get_idx(filesJ, idx);
json_object *responseJ = ScanForConfig(CONTROL_CONFIG_PATH ,CTL_SCAN_RECURSIVE, json_object_get_string(oneFileJ), ".json");
responseJ = responseJ ? responseJ:
- ScanForConfig(GetBindingDirPath(), CTL_SCAN_RECURSIVE, json_object_get_string(oneFileJ), ".json");
+ ScanForConfig(bindingPath, CTL_SCAN_RECURSIVE, json_object_get_string(oneFileJ), ".json");
if(!responseJ) {
- AFB_ApiError(apiHandle, "No config files found in search path. No changes has been made\n -- %s\n -- %s", CONTROL_CONFIG_PATH, GetBindingDirPath());
+ AFB_ApiError(apiHandle, "No config files found in search path. No changes has been made\n -- %s\n -- %s", CONTROL_CONFIG_PATH, bindingPath);
return sectionArrayJ;
}
const char *oneFile = ConfigSearch(apiHandle, responseJ);
@@ -202,9 +203,9 @@ json_object* CtlUpdateSectionConfig(AFB_ApiT apiHandle, CtlConfigT *ctlHandle, c
} else {
json_object *responseJ = ScanForConfig(CONTROL_CONFIG_PATH ,CTL_SCAN_RECURSIVE, json_object_get_string(filesJ), ".json");
responseJ = responseJ ? responseJ:
- ScanForConfig(GetBindingDirPath(), CTL_SCAN_RECURSIVE, json_object_get_string(filesJ), ".json");
+ ScanForConfig(bindingPath, CTL_SCAN_RECURSIVE, json_object_get_string(filesJ), ".json");
if(!responseJ) {
- AFB_ApiError(apiHandle, "No config files found in search path. No changes has been made\n -- %s\n -- %s", CONTROL_CONFIG_PATH, GetBindingDirPath());
+ AFB_ApiError(apiHandle, "No config files found in search path. No changes has been made\n -- %s\n -- %s", CONTROL_CONFIG_PATH, bindingPath);
return sectionArrayJ;
}
const char *oneFile = ConfigSearch(apiHandle, responseJ);