diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2017-03-10 20:07:08 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2017-03-10 23:24:20 -0500 |
commit | cdd5a772e8b8ef34de529207252c8130d62a87a2 (patch) | |
tree | d6f0db26b3a7dc3ebd2400c8ca6464a1cd1678b1 | |
parent | 0a3c23bcf65cba76fc9cad2854504586901ea5e9 (diff) | |
download | kutter-cdd5a772e8b8ef34de529207252c8130d62a87a2.tar.gz kutter-cdd5a772e8b8ef34de529207252c8130d62a87a2.tar.xz kutter-cdd5a772e8b8ef34de529207252c8130d62a87a2.zip |
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 <kevin@koconnor.net>
-rw-r--r-- | src/sched.c | 3 |
1 files changed, 2 insertions, 1 deletions
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); } |