From: Felix Fietkau Date: Fri, 29 Jul 2016 10:03:50 +0000 (+0200) Subject: trigger: replace trigger_init() with static runqueue initialization X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=8eecf942b50d88dbcd7517817fe5c557f10541e0;p=project%2Fprocd.git trigger: replace trigger_init() with static runqueue initialization Signed-off-by: Felix Fietkau --- diff --git a/procd.c b/procd.c index a7ac6c1..dd4909e 100644 --- a/procd.c +++ b/procd.c @@ -73,7 +73,6 @@ int main(int argc, char **argv) setsid(); uloop_init(); procd_signal(); - trigger_init(); if (getpid() != 1) procd_connect_ubus(); else diff --git a/procd.h b/procd.h index e87c87a..88886a3 100644 --- a/procd.h +++ b/procd.h @@ -46,7 +46,6 @@ void procd_inittab_run(const char *action); void procd_bcast_event(char *event, struct blob_attr *msg); struct trigger; -void trigger_init(void); void trigger_event(const char *type, struct blob_attr *data); void trigger_add(struct blob_attr *rule, void *id); void trigger_del(void *id); diff --git a/service/trigger.c b/service/trigger.c index 042b3b6..55d07e4 100644 --- a/service/trigger.c +++ b/service/trigger.c @@ -62,7 +62,7 @@ struct job { }; static LIST_HEAD(triggers); -static struct runqueue q; +static RUNQUEUE(q, 1); static const char* rule_handle_var(struct json_script_ctx *ctx, const char *name, struct blob_attr *vars) { @@ -312,12 +312,6 @@ void trigger_del(void *id) } } -void trigger_init(void) -{ - runqueue_init(&q); - q.max_running_tasks = 1; -} - static bool trigger_match(const char *event, const char *match) { char *wildcard = strstr(match, ".*");