aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Aillet <jonathan.aillet@iot.bzh>2018-05-26 19:55:05 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-06-29 19:38:23 +0200
commit33edd589200665712772e8cd483b25ed104ed005 (patch)
tree62a7bcc14ababbfbf32209255565a58b554d0477
parent0ec4943835b4409cc2c8df9bbf9383c2e7e83c9a (diff)
Prevent lost of config file path when searching
Prevent lost of config file path when searching by keeping only the first file found. Add a warning if multiple files are found. Change-Id: I97262c4dbbc53bb921ef25b9100491cf3e29a056 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
-rw-r--r--ctl-lib/ctl-config.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ctl-lib/ctl-config.c b/ctl-lib/ctl-config.c
index 4b9f2f7..8a0b07f 100644
--- a/ctl-lib/ctl-config.c
+++ b/ctl-lib/ctl-config.c
@@ -85,6 +85,9 @@ char* ConfigSearch(AFB_ApiT apiHandle, json_object *responseJ) {
strncat(filepath, "/", p_length - strlen(filepath));
strncat(filepath, filename, p_length - strlen(filepath));
}
+ else {
+ AFB_ApiWarning(apiHandle, "CTL-INIT JSON file found but not used : %s/%s", fullpath, filename);
+ }
}
json_object_put(responseJ);