netifd: process reload calls immediately instead of going through a timer
authorFelix Fietkau <nbd@openwrt.org>
Wed, 11 Jun 2014 10:18:46 +0000 (12:18 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Wed, 11 Jun 2014 10:18:46 +0000 (12:18 +0200)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
main.c

diff --git a/main.c b/main.c
index c5e8e67b2f66dfa5e3e16d31e34a0c33a42e6c88..bbae97b72238e1333b3c3ced59bcb9ac30b75bd4 100644 (file)
--- 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);
 }