diff options
Diffstat (limited to 'libs/libc/sys.c')
-rw-r--r-- | libs/libc/sys.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libs/libc/sys.c b/libs/libc/sys.c index b00bd32..c6b7fa3 100644 --- a/libs/libc/sys.c +++ b/libs/libc/sys.c @@ -189,12 +189,20 @@ static void atexit_trigger(void) if (!slot) return; + static u8 cnt = 0; + if (cnt++ != 0) { + log("Couldn't execute all atexit routines\n"); + return; + } + while (slot-- > 0) { if (funcs[slot]) { funcs[slot](); funcs[slot] = NULL; } } + + cnt = 0; } void atexit(void (*func)(void)) |