Remove duplicated do_start, return the recturn code from payload.rpx

This commit is contained in:
Maschell 2021-12-30 16:01:06 +01:00
parent 9aa4f34190
commit 98e3c0882b

View File

@ -82,8 +82,6 @@ extern "C" int _start(int argc, char **argv) {
auto heap = (MEMExpHeap *) mem2_heap_handle; auto heap = (MEMExpHeap *) mem2_heap_handle;
MEMExpHeapBlock *memory_start = heap->usedList.tail; MEMExpHeapBlock *memory_start = heap->usedList.tail;
int res = do_start(argc, argv);
uint32_t entrypoint = do_start(argc, argv); uint32_t entrypoint = do_start(argc, argv);
// free leaked memory // free leaked memory
@ -105,8 +103,7 @@ extern "C" int _start(int argc, char **argv) {
__fini_wut(); __fini_wut();
if (entrypoint > 0) { if (entrypoint > 0) {
((int (*)(int, char **)) entrypoint)(argc, argv); return ((int (*)(int, char **)) entrypoint)(argc, argv);
_Exit(0);
} }
return -1; return -1;