X-Git-Url: https://git.distorted.org.uk/~mdw/secnet/blobdiff_plain/ae5ae3bf5c5709938e3a2bb6203094ede8af45e6..eecff7e35bcb1dbde57c380dc13649c3fc579e92:/util.c diff --git a/util.c b/util.c index c459f13..d843859 100644 --- a/util.c +++ b/util.c @@ -204,7 +204,8 @@ static const char *phases[NR_PHASES]={ "PHASE_GETRESOURCES", "PHASE_DROPPRIV", "PHASE_RUN", - "PHASE_SHUTDOWN" + "PHASE_SHUTDOWN", + "PHASE_CHILDPERSIST" }; void enter_phase(uint32_t new_phase) @@ -227,6 +228,14 @@ void phase_hooks_init(void) LIST_INIT(&hooks[i]); } +void clear_phase_hooks(uint32_t phase) +{ + struct phase_hook *h, *htmp; + LIST_FOREACH_SAFE(h, &hooks[phase], entry, htmp) + free(h); + LIST_INIT(&hooks[phase]); +} + bool_t add_hook(uint32_t phase, hook_fn *fn, void *state) { struct phase_hook *h;