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 b62da0a..0bb881e 100644 (file)
--- a/signal.c
+++ b/signal.c
@@ -26,7 +26,6 @@ static void do_reboot(void)
        LOG("reboot\n");
        fflush(stderr);
        sync();
        LOG("reboot\n");
        fflush(stderr);
        sync();
-       sleep(1);
        reboot(RB_AUTOBOOT);
        while (1)
        ;
        reboot(RB_AUTOBOOT);
        while (1)
        ;
diff --git a/state.c b/state.c
index 618d758..cf0c81d 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");
        case STATE_SHUTDOWN:
                LOG("- shutdown -\n");
                procd_inittab_run("shutdown");
+               sync();
                break;
 
        case STATE_HALT:
                LOG("- reboot -\n");
                break;
 
        case STATE_HALT:
                LOG("- reboot -\n");
-               sync();
-               sleep(1);
                reboot(reboot_event);
                break;
 
                reboot(reboot_event);
                break;