From 11e1c42df69b15c938aa1b7570e4370e6ab15a86 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Mon, 17 Nov 2008 06:35:08 +0000 Subject: completed implementation of "trigger" for init --- init/builtins.c | 2 ++ init/init.c | 4 +--- init/init.h | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'init') diff --git a/init/builtins.c b/init/builtins.c index 93ce6e8..43c29eb 100644 --- a/init/builtins.c +++ b/init/builtins.c @@ -400,6 +400,8 @@ int do_restart(int nargs, char **args) int do_trigger(int nargs, char **args) { + action_for_each_trigger(args[1], action_add_queue_tail); + drain_action_queue(); return 0; } diff --git a/init/init.c b/init/init.c index dfc858a..896aff8 100644 --- a/init/init.c +++ b/init/init.c @@ -65,8 +65,6 @@ static struct input_keychord *keychords = 0; static int keychords_count = 0; static int keychords_length = 0; -static void drain_action_queue(void); - static void notify_service_state(const char *name, const char *state) { char pname[PROP_NAME_MAX]; @@ -667,7 +665,7 @@ static void get_hardware_name(void) } } -static void drain_action_queue(void) +void drain_action_queue(void) { struct listnode *node; struct command *cmd; diff --git a/init/init.h b/init/init.h index f306b7b..60c3055 100644 --- a/init/init.h +++ b/init/init.h @@ -165,6 +165,7 @@ void service_stop(struct service *svc); void service_start(struct service *svc, const char *dynamic_args); void property_changed(const char *name, const char *value); +void drain_action_queue(void); struct action *action_remove_queue_head(void); void action_add_queue_tail(struct action *act); void action_for_each_trigger(const char *trigger, -- cgit v1.1