aboutsummaryrefslogtreecommitdiffstats
path: root/ctl-lib/ctl-config.c
diff options
context:
space:
mode:
authorJonathan Aillet <jonathan.aillet@iot.bzh>2019-07-17 12:09:34 +0200
committerJonathan Aillet <jonathan.aillet@iot.bzh>2019-07-17 12:09:34 +0200
commit5a5d52285f32811215c2ffce280c2ac55a5b8599 (patch)
tree113252c9667e0cafc67472e4c3a36e0cabb792dd /ctl-lib/ctl-config.c
parent0d0e561b703ca0f62f23a187cd4a7555ddc33f78 (diff)
Avoid a 'return -0' when an error has been caught during first section callback execution. Bug-AGL: SPEC-2568 Change-Id: Ic407f8be0afd0236b1880b6c33e5339470f68b33 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
Diffstat (limited to 'ctl-lib/ctl-config.c')
-rw-r--r--ctl-lib/ctl-config.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ctl-lib/ctl-config.c b/ctl-lib/ctl-config.c
index cd89bc0..2970955 100644
--- a/ctl-lib/ctl-config.c
+++ b/ctl-lib/ctl-config.c
@@ -163,7 +163,7 @@ int CtlConfigExec(afb_api_t apiHandle, CtlConfigT *ctlConfig) {
error = ctlConfig->sections[idx].loadCB(apiHandle, &ctlConfig->sections[idx], NULL);
if (error < 0) {
AFB_API_ERROR(apiHandle, "Error %i caught during call to '%s' section callback", error, ctlConfig->sections[idx].key);
- return -idx;
+ return -(idx + 1);
}
else if (error > 0) {
AFB_API_WARNING(apiHandle, "Warning %i raised during call to '%s' section callback", error, ctlConfig->sections[idx].key);