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

fix from broken skip-builtin option

This commit is contained in:
Steffen Vogel 2019-04-02 09:17:59 -04:00
parent 289cd6e10c
commit 1dbc12df6d
2 changed files with 9 additions and 4 deletions

View file

@ -109,6 +109,9 @@ int hook_list_prepare(vlist *hs, vlist *sigs, int m, struct path *p, struct node
{
assert(hs->state == STATE_INITIALIZED);
if (!m)
goto skip_add;
/* Add internal hooks if they are not already in the list */
for (auto f : plugin::Registry::lookup<HookFactory>()) {
if ((f->getFlags() & m) == m) {
@ -118,6 +121,7 @@ int hook_list_prepare(vlist *hs, vlist *sigs, int m, struct path *p, struct node
}
}
skip_add:
/* We sort the hooks according to their priority */
vlist_sort(hs, (cmp_cb_t) hook_cmp_priority);

View file

@ -221,11 +221,12 @@ int node_direction_stop(struct node_direction *nd, struct node *n)
struct vlist * node_direction_get_signals(struct node_direction *nd)
{
#ifdef WITH_HOOKS
assert(nd->state == STATE_PREPARED);
return hook_list_get_signals(&nd->hooks);
#else
return &nd->signals;
#ifdef WITH_HOOKS
if (vlist_length(&nd->hooks) > 0)
return hook_list_get_signals(&nd->hooks);
#endif
return &nd->signals;
}