summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichel Stam <m.stam@fugro.nl>2014-10-02 13:56:16 +0200
committerJohn Crispin <blogic@openwrt.org>2014-10-02 19:08:39 +0200
commit396a82c551ab02871ec0e6f399941c9379258bdc (patch)
tree2e383d48a1a2059e743350c062c6b7d6ffc4de58
parentc1a558f7d0c1e6c1ffa5a47d557a7b45205eef1d (diff)
downloadunitd-396a82c551ab02871ec0e6f399941c9379258bdc.tar
unitd-396a82c551ab02871ec0e6f399941c9379258bdc.zip
Fix procd not handling rapid reboot signals very well
When keeping ctrl-alt-del pressed, or when running; while true; do /sbin/reboot done effectively the procd shutdown cycle gets into an undefined state, Signed-off-by: Michel Stam <m.stam@fugro.nl>
-rw-r--r--state.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/state.c b/state.c
index e5f0015..bba5966 100644
--- a/state.c
+++ b/state.c
@@ -94,6 +94,8 @@ void procd_state_next(void)
void procd_shutdown(int event)
{
+ if (state >= STATE_SHUTDOWN)
+ return;
DEBUG(2, "Shutting down system with event %x\n", event);
reboot_event = event;
state = STATE_SHUTDOWN;