mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-06-02 07:39:49 -04:00
creport: Solidify main() logic.
This commit is contained in:
parent
851d21a276
commit
4e7fcc1a50
3 changed files with 49 additions and 7 deletions
|
@ -94,12 +94,27 @@ int main(int argc, char **argv) {
|
|||
|
||||
/* Try to debug the crashed process. */
|
||||
g_Creport.BuildReport(crashed_pid, argv[1][0] == '1');
|
||||
|
||||
if (R_SUCCEEDED(nsdevInitialize())) {
|
||||
nsdevTerminateProcess(crashed_pid);
|
||||
nsdevExit();
|
||||
if (g_Creport.WasSuccessful()) {
|
||||
if (R_SUCCEEDED(nsdevInitialize())) {
|
||||
nsdevTerminateProcess(crashed_pid);
|
||||
nsdevExit();
|
||||
}
|
||||
|
||||
/* Don't fatal if we have extra info. */
|
||||
if (kernelAbove500()) {
|
||||
if (g_Creport.IsApplication()) {
|
||||
return 0;
|
||||
}
|
||||
} else if (argv[1][0] == '1') {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Also don't fatal if we're a user break. */
|
||||
if (g_Creport.IsUserBreak()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
fatalWithType(g_Creport.GetResult(), FatalType_ErrorScreen);
|
||||
}
|
||||
|
||||
/* TODO: fatalWithType(<report error>, FatalType_ErrorScreen); */
|
||||
fatalWithType(0, FatalType_ErrorScreen);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue