__ctru_exit(): perform svcExitProcess() if there's no retAddr

This commit is contained in:
fincs 2014-08-20 22:16:28 +02:00
parent 85a96370e0
commit 0a1d0403d1
2 changed files with 5 additions and 5 deletions

View File

@ -27,9 +27,9 @@ typedef enum {
u32* getThreadCommandBuffer(void);
s32 svcControlMemory(u32* addr_out, u32 addr0, u32 addr1, u32 size, MemOp op, MemPerm perm);
void svcExitProcess();
void __attribute__((noreturn)) svcExitProcess();
s32 svcCreateThread(Handle* thread, ThreadFunc entrypoint, u32 arg, u32* stack_top, s32 thread_priority, s32 processor_id);
void svcExitThread();
void __attribute__((noreturn)) svcExitThread();
void svcSleepThread(s64 ns);
s32 svcCreateMutex(Handle* mutex, bool initially_locked);
s32 svcReleaseMutex(Handle handle);

View File

@ -20,7 +20,7 @@ extern char* fake_heap_end;
static void initArgv();
void __ctru_exit(int rc)
void __attribute__((noreturn)) __ctru_exit(int rc)
{
// Run the global destructors
__libc_fini_array();
@ -35,8 +35,8 @@ void __ctru_exit(int rc)
if (__system_retAddr)
__system_retAddr();
// Since above did not jump: hang
for (;;);
// Since above did not jump, end this process
svcExitProcess();
}
void initSystem(void (*retAddr)(void))