get rid of sleep() calls
authorJohn Crispin <blogic@openwrt.org>
Thu, 27 Jun 2013 17:14:03 +0000 (19:14 +0200)
committerJohn Crispin <blogic@openwrt.org>
Thu, 27 Jun 2013 18:20:18 +0000 (20:20 +0200)
Signed-off-by: John Crispin <blogic@openwrt.org>
signal.c
state.c

index b62da0a8c1ce1016f0051959390e25ac88b030cb..0bb881e4435bc06881598140c5aaa5abcbf54589 100644 (file)
--- a/signal.c
+++ b/signal.c
@@ -26,7 +26,6 @@ static void do_reboot(void)
        LOG("reboot\n");
        fflush(stderr);
        sync();
-       sleep(1);
        reboot(RB_AUTOBOOT);
        while (1)
        ;
diff --git a/state.c b/state.c
index 618d75879051a3e042da6763f196a11e599a59d1..cf0c81d2c6f19e263eef3ae2a890684c19ead771 100644 (file)
--- a/state.c
+++ b/state.c
@@ -63,12 +63,11 @@ static void state_enter(void)
        case STATE_SHUTDOWN:
                LOG("- shutdown -\n");
                procd_inittab_run("shutdown");
+               sync();
                break;
 
        case STATE_HALT:
                LOG("- reboot -\n");
-               sync();
-               sleep(1);
                reboot(reboot_event);
                break;