mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
improve hook_list_get_signals
This commit is contained in:
parent
9d7a6ab10f
commit
e0c622af86
2 changed files with 5 additions and 8 deletions
|
@ -204,6 +204,8 @@ void hook_list_stop(struct vlist *hs)
|
|||
struct vlist * hook_list_get_signals(struct vlist *hs)
|
||||
{
|
||||
Hook *h = (Hook *) vlist_last(hs);
|
||||
if (!h)
|
||||
return nullptr;
|
||||
|
||||
return h->getSignals();
|
||||
}
|
||||
|
|
11
lib/path.cpp
11
lib/path.cpp
|
@ -817,16 +817,11 @@ bool path_is_reversed(const struct vpath *p)
|
|||
struct vlist * path_output_signals(struct vpath *p)
|
||||
{
|
||||
#ifdef WITH_HOOKS
|
||||
if (vlist_length(&p->hooks) > 0) {
|
||||
Hook *last_hook = (Hook *) vlist_last(&p->hooks);
|
||||
if (vlist_length(&p->hooks) > 0)
|
||||
return hook_list_get_signals(&p->hooks);
|
||||
#endif /* WITH_HOOKS */
|
||||
|
||||
return last_hook->getSignals();
|
||||
}
|
||||
else
|
||||
return &p->signals;
|
||||
#else
|
||||
return &p->signals;
|
||||
#endif
|
||||
}
|
||||
|
||||
json_t * path_to_json(struct vpath *p)
|
||||
|
|
Loading…
Add table
Reference in a new issue