From 876ed07554ef42b4a783fbdef5b44ac20face33a Mon Sep 17 00:00:00 2001 From: Jief L Date: Tue, 31 Mar 2020 09:10:47 +0300 Subject: [PATCH] Cleanup panic() function. --- rEFIt_UEFI/cpp_util/panic.cpp | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/rEFIt_UEFI/cpp_util/panic.cpp b/rEFIt_UEFI/cpp_util/panic.cpp index 6cfa067e1..661e7ecbf 100644 --- a/rEFIt_UEFI/cpp_util/panic.cpp +++ b/rEFIt_UEFI/cpp_util/panic.cpp @@ -12,27 +12,25 @@ bool i_have_panicked = false; * * Function panic_ seems useless. It's same as panic(). It's to be able to put a breakpoint in gdb with br panic_(). This is done in gdb_launch script in Qemu */ -void panic_(const char* s) +static void panic_(const char* s) { - if ( stop_at_panic ) { - if ( s ) DebugLog(2, "%s\n", s); - DebugLog(2, "A fatal error happened. System halted\n"); - CpuDeadLoop(); - }else{ -// if ( s ) DebugLog(2, "%s\n", s); -// DebugLog(2, "A fatal error happened. Continue for testing\n"); - i_have_panicked = true; - } + if ( s ) DebugLog(2, "%s\n", s); + DebugLog(2, "A fatal error happened. System halted\n"); + CpuDeadLoop(); } void panic(const char* s) { - panic_(s); + if ( stop_at_panic ) { + panic_(s); + }else{ + i_have_panicked = true; + } } void panic(void) { - panic_(nullptr); + panic(nullptr); }