1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

fixup hook init

This commit is contained in:
Steffen Vogel 2018-08-17 12:52:31 +02:00
parent a5edd4c0f5
commit f693b2ffe3
2 changed files with 6 additions and 2 deletions

View file

@ -99,8 +99,12 @@ static int node_direction_parse(struct node_direction *nd, struct node *n, json_
jerror(&err, "Failed to parse node %s", node_name(n));
#ifdef WITH_HOOKS
int m = nd == &n->out
? HOOK_NODE_WRITE
: HOOK_NODE_READ;
if (json_hooks) {
ret = hook_parse_list(&nd->hooks, json_hooks, NULL, n);
ret = hook_parse_list(&nd->hooks, json_hooks, m, NULL, n);
if (ret < 0)
return ret;
}

View file

@ -592,7 +592,7 @@ int path_parse(struct path *p, json_t *cfg, struct list *nodes)
#ifdef WITH_HOOKS
if (json_hooks) {
ret = hook_parse_list(&p->hooks, json_hooks, p, NULL);
ret = hook_parse_list(&p->hooks, json_hooks, HOOK_PATH, p, NULL);
if (ret)
return ret;
}