aboutsummaryrefslogtreecommitdiffstats
path: root/ctl-lib/ctl-onload.c
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2018-08-29 14:03:05 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-09-06 10:36:22 +0200
commitd6eb01e14f2340c950ff8476d7b112f91297aae2 (patch)
tree31549f90a6fc5377d775ee6438f10e341348b191 /ctl-lib/ctl-onload.c
parentc3a70d7718d51f2266ce671ee112a25398df0765 (diff)
Change loading configuration object behaviorflounder_5.99.6flounder/5.99.65.99.6
This changes the default behavior when loading actions. Now, it appends the new actions to the old ones instead of replacing them when called several times. If there were no actions previously loaded then it just loads normally the actions. Change-Id: Ica58a3edf4a9bf18ae31c6b6a5fa329e7ec5478b Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'ctl-lib/ctl-onload.c')
-rw-r--r--ctl-lib/ctl-onload.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/ctl-lib/ctl-onload.c b/ctl-lib/ctl-onload.c
index 9baa689..b537590 100644
--- a/ctl-lib/ctl-onload.c
+++ b/ctl-lib/ctl-onload.c
@@ -28,13 +28,10 @@ int OnloadConfig(AFB_ApiT apiHandle, CtlSectionT *section, json_object *actionsJ
// Load time parse actions in control file
if (actionsJ != NULL) {
- section->actions= ActionConfig(apiHandle, actionsJ, 0);
-
- if (!section->actions) {
- AFB_ApiError (apiHandle, "OnloadConfig control fail processing onload actions");
- return 1;
+ if ( (err= AddActionsToSection(apiHandle, section, actionsJ, 0)) ) {
+ AFB_ApiError (apiHandle, "OnloadConfig control fail processing actions for section %s", section->uid);
+ return err;
}
-
} else {
// Exec time process onload action now
if (!section->actions) {