mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-22 21:02:39 +02:00
Panic if any initialization fails
This commit is contained in:
parent
61494b77cc
commit
844f72fe67
@ -36,4 +36,8 @@ enum {
|
|||||||
LIBNX_HEAPALLOCFAILED,
|
LIBNX_HEAPALLOCFAILED,
|
||||||
LIBNX_TOOMANYOVERRIDES,
|
LIBNX_TOOMANYOVERRIDES,
|
||||||
LIBNX_PARCELERROR,
|
LIBNX_PARCELERROR,
|
||||||
|
LIBNX_INITFAIL_SM,
|
||||||
|
LIBNX_INITFAIL_AM,
|
||||||
|
LIBNX_INITFAIL_HID,
|
||||||
|
LIBNX_INITFAIL_FS
|
||||||
};
|
};
|
||||||
|
@ -61,12 +61,25 @@ void __attribute__((weak)) __libnx_initheap(void)
|
|||||||
|
|
||||||
void __attribute__((weak)) __appInit(void)
|
void __attribute__((weak)) __appInit(void)
|
||||||
{
|
{
|
||||||
// Initialize default services.
|
Result rc;
|
||||||
smInitialize();
|
|
||||||
appletInitialize();
|
// Initialize default services.
|
||||||
hidInitialize();
|
rc = smInitialize();
|
||||||
|
if (R_FAILED(rc))
|
||||||
|
fatalSimple(MAKERESULT(MODULE_LIBNX, LIBNX_INITFAIL_SM));
|
||||||
|
|
||||||
|
rc = appletInitialize();
|
||||||
|
if (R_FAILED(rc))
|
||||||
|
fatalSimple(MAKERESULT(MODULE_LIBNX, LIBNX_INITFAIL_AM));
|
||||||
|
|
||||||
|
rc = hidInitialize();
|
||||||
|
if (R_FAILED(rc))
|
||||||
|
fatalSimple(MAKERESULT(MODULE_LIBNX, LIBNX_INITFAIL_HID));
|
||||||
|
|
||||||
|
rc = fsInitialize();
|
||||||
|
if (R_FAILED(rc))
|
||||||
|
fatalSimple(MAKERESULT(MODULE_LIBNX, LIBNX_INITFAIL_FS));
|
||||||
|
|
||||||
fsInitialize();
|
|
||||||
//fsdevInit();
|
//fsdevInit();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,7 +88,6 @@ void __attribute__((weak)) __appExit(void)
|
|||||||
// Cleanup default services.
|
// Cleanup default services.
|
||||||
//fsdevExit();
|
//fsdevExit();
|
||||||
fsExit();
|
fsExit();
|
||||||
|
|
||||||
hidExit();
|
hidExit();
|
||||||
appletExit();
|
appletExit();
|
||||||
smExit();
|
smExit();
|
||||||
|
Loading…
Reference in New Issue
Block a user