mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
hooks: node hooks can only be added to nodes, paths hooks only to paths
This commit is contained in:
parent
cd59d63db5
commit
24e371215a
1 changed files with 6 additions and 0 deletions
|
@ -40,6 +40,12 @@ int hook_init(struct hook *h, struct hook_type *vt, struct path *p, struct node
|
|||
|
||||
h->priority = vt->priority;
|
||||
|
||||
/* Node hooks can only used with nodes,
|
||||
Path hooks only with paths.. */
|
||||
if ((!(vt->flags & HOOK_NODE) && n) ||
|
||||
(!(vt->flags & HOOK_PATH) && p))
|
||||
return -1;
|
||||
|
||||
h->path = p;
|
||||
h->node = n;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue