From cdd5a772e8b8ef34de529207252c8130d62a87a2 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Fri, 10 Mar 2017 20:07:08 -0500 Subject: [PATCH] sched: Don't overwrite shutdown reason if shutdown called while shutdown If a shutdown occurs while the machine is already shutdown, then keep the original shutdown reason code. Signed-off-by: Kevin O'Connor --- src/sched.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sched.c b/src/sched.c index 7e4a86a1..6ccf8e5a 100644 --- a/src/sched.c +++ b/src/sched.c @@ -276,7 +276,8 @@ void sched_shutdown(unsigned int reason) { irq_disable(); - shutdown_reason = reason; + if (!shutdown_status) + shutdown_reason = reason; longjmp(shutdown_jmp, 1); }