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

these hooks do not use HOOK_{INIT,DEINIT} to lets return early to not fail the assertion

This commit is contained in:
Steffen Vogel 2016-10-30 22:57:58 -04:00
parent 0d58df66e7
commit 248a6638da

View file

@ -16,6 +16,9 @@ REGISTER_HOOK("fix_ts", "Update timestamps of sample if not set", 0, 0, hook_fix
int hook_fix_ts(struct hook *h, int when, struct hook_info *j)
{
struct timespec now = time_now();
if (when != HOOK_READ)
return 0;
assert(j->smps);
@ -41,6 +44,9 @@ int hook_fix_ts(struct hook *h, int when, struct hook_info *j)
REGISTER_HOOK("restart", "Call restart hooks for current path", 1, 1, hook_restart, HOOK_INTERNAL | HOOK_READ)
int hook_restart(struct hook *h, int when, struct hook_info *j)
{
if (when != HOOK_READ)
return 0;
assert(j->smps);
assert(j->path);
@ -68,6 +74,9 @@ int hook_drop(struct hook *h, int when, struct hook_info *j)
{
int i, ok, dist;
if (when != HOOK_READ)
return 0;
assert(j->smps);
for (i = 0, ok = 0; i < j->cnt; i++) {