Browse Source

trigger: replace trigger_init() with static runqueue initialization

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Felix Fietkau 7 years ago
parent
commit
8eecf942b5
3 changed files with 1 additions and 9 deletions
  1. 0 1
      procd.c
  2. 0 1
      procd.h
  3. 1 7
      service/trigger.c

+ 0 - 1
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

+ 0 - 1
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);

+ 1 - 7
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, ".*");