mirror of
https://github.com/troglobit/finit.git
synced 2026-11-03 13:28:27 +00:00
Remove service condition when service is deleted
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
fb16abd855
commit
46683f8eb8
1 file changed
+3
@@ -35,6 +35,7 @@
|
|||||||
#include "helpers.h"
|
#include "helpers.h"
|
||||||
#include "pid.h"
|
#include "pid.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
#include "cond.h"
|
||||||
|
|
||||||
/* Each svc_t needs a unique job# */
|
/* Each svc_t needs a unique job# */
|
||||||
static int jobcounter = 1;
|
static int jobcounter = 1;
|
||||||
@@ -56,6 +57,7 @@ static void gc(uev_t *w, void *arg, int events)
|
|||||||
|
|
||||||
clock_gettime(CLOCK_MONOTONIC_COARSE, &now);
|
clock_gettime(CLOCK_MONOTONIC_COARSE, &now);
|
||||||
TAILQ_FOREACH_SAFE(svc, &gc_list, link, next) {
|
TAILQ_FOREACH_SAFE(svc, &gc_list, link, next) {
|
||||||
|
char cond[MAX_COND_LEN];
|
||||||
int msec;
|
int msec;
|
||||||
|
|
||||||
msec = (now.tv_sec - svc->gc.tv_sec) * 1000 +
|
msec = (now.tv_sec - svc->gc.tv_sec) * 1000 +
|
||||||
@@ -64,6 +66,7 @@ static void gc(uev_t *w, void *arg, int events)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
TAILQ_REMOVE(&gc_list, svc, link);
|
TAILQ_REMOVE(&gc_list, svc, link);
|
||||||
|
cond_clear(mkcond(cond, sizeof(cond), svc->cmd));
|
||||||
free(svc);
|
free(svc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user