diff options
author | Matt Joyce <matthew.joyce@embedded-brains.de> | 2022-05-03 07:51:22 +0300 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2022-05-13 13:35:00 +0300 |
commit | 26747c47bc0a1137e02e0377306d721cc3478855 (patch) | |
tree | 6e776f95a671c07174316f1889dbfb1c9b23d39b /newlib/libc/stdlib | |
parent | 4b28f3c125c4a4a17d5084548393962778ab27b2 (diff) |
Add stdio_exit_handler()
Add a dedicated stdio exit handler to avoid using _GLOBAL_REENT in exit().
Diffstat (limited to 'newlib/libc/stdlib')
-rw-r--r-- | newlib/libc/stdlib/exit.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/newlib/libc/stdlib/exit.c b/newlib/libc/stdlib/exit.c index 3e618914e..9b7bd518b 100644 --- a/newlib/libc/stdlib/exit.c +++ b/newlib/libc/stdlib/exit.c @@ -59,7 +59,8 @@ exit (int code) #endif __call_exitprocs (code, NULL); - if (_GLOBAL_REENT->__cleanup) - (*_GLOBAL_REENT->__cleanup) (_GLOBAL_REENT); + if (__stdio_exit_handler != NULL) + (*__stdio_exit_handler) (); + _exit (code); } |