From 5db02763d61785529bef538f196c180e968b7c26 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 11 Jun 2014 12:18:46 +0200 Subject: [PATCH] netifd: process reload calls immediately instead of going through a timer Signed-off-by: Felix Fietkau --- main.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/main.c b/main.c index c5e8e67..bbae97b 100644 --- a/main.c +++ b/main.c @@ -211,22 +211,17 @@ static void netifd_do_restart(struct uloop_timeout *timeout) execvp(global_argv[0], global_argv); } -static void netifd_do_reload(struct uloop_timeout *timeout) -{ - config_init_all(); -} - -static struct uloop_timeout main_timer; - void netifd_reload(void) { - main_timer.cb = netifd_do_reload; - uloop_timeout_set(&main_timer, 100); + config_init_all(); } void netifd_restart(void) { - main_timer.cb = netifd_do_restart; + static struct uloop_timeout main_timer = { + .cb = netifd_do_restart + }; + interface_set_down(NULL); uloop_timeout_set(&main_timer, 1000); } -- 2.25.1