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

skip hooks as soon as possible

This commit is contained in:
Steffen Vogel 2015-10-14 12:13:47 +02:00
parent 1bf6d9e50a
commit ab8723ba8f

View file

@ -42,9 +42,14 @@ static void path_write(struct path *p)
int path_run_hook(struct path *p, enum hook_type t)
{
int ret = 0;
list_foreach(struct hook *h, &p->hooks) {
if (h->type & t)
ret += ((hook_cb_t) h->cb)(p, h, t);
if (h->type & t) {
ret = ((hook_cb_t) h->cb)(p, h, t);
debug(22, "Running hook when=%u '%s' prio=%u ret=%d", t, h->name, h->priority, ret);
if (ret)
return ret;
}
}
return ret;