diff --git a/lib/hooks/stats_collect.c b/lib/hooks/stats_collect.c index 9ed5e8194..0c3309093 100644 --- a/lib/hooks/stats_collect.c +++ b/lib/hooks/stats_collect.c @@ -24,6 +24,7 @@ * @{ */ +#include "common.h" #include "hook.h" #include "plugin.h" #include "stats.h" @@ -111,7 +112,8 @@ static int stats_collect_periodic(struct hook *h) { struct stats_collect *p = h->_vd; - stats_print_periodic(&p->stats, p->output, p->format, p->verbose, h->path); + if (h->path->state == STATE_STARTED) + stats_print_periodic(&p->stats, p->output, p->format, p->verbose, h->path); return 0; }