mirror of
https://github.com/switchbrew/libnx.git
synced 2025-07-05 10:52:15 +02:00
Fatal: Only exit process if required, exit cleanly.
This commit is contained in:
parent
aee9ba4706
commit
5754be9ff9
@ -26,4 +26,4 @@ void NORETURN fatalSimple(Result err);
|
||||
* @param err[in] Type of fatal error to throw.
|
||||
* @note This function does not return.
|
||||
*/
|
||||
void NORETURN fatalWithType(Result err, FatalType type);
|
||||
void fatalWithType(Result err, FatalType type);
|
||||
|
@ -10,9 +10,11 @@
|
||||
void NORETURN fatalSimple(Result err) {
|
||||
/* By default, do not generate an error report. */
|
||||
fatalWithType(err, FatalType_ErrorScreen);
|
||||
svcExitProcess();
|
||||
__builtin_unreachable();
|
||||
}
|
||||
|
||||
void NORETURN fatalWithType(Result err, FatalType type) {
|
||||
void fatalWithType(Result err, FatalType type) {
|
||||
Result rc = 0;
|
||||
|
||||
if (detectDebugger()) {
|
||||
@ -50,6 +52,13 @@ void NORETURN fatalWithType(Result err, FatalType type) {
|
||||
}
|
||||
}
|
||||
|
||||
((void(*)())0xBADC0DE)();
|
||||
switch (type) {
|
||||
case FatalType_ErrorReport:
|
||||
break;
|
||||
case FatalType_ErrorReportAndErrorScreen:
|
||||
case FatalType_ErrorScreen:
|
||||
default:
|
||||
svcExitProcess();
|
||||
__builtin_unreachable();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user