summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2020-08-15 21:34:48 -0400
committerJakob Kaivo <jkk@ung.org>2020-08-15 21:34:48 -0400
commitef00601333c4d825ef3333cb19dd57bfc8f0d82f (patch)
treed260c78be33e44887537da8fe430df5d2758f824 /src
parent7aa17202e778894e1a27a5d48fb8bcb657b4820e (diff)
just call fflush(NULL) to flush all streams, let process teardown handle closing
Diffstat (limited to 'src')
-rw-r--r--src/stdlib/exit.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/stdlib/exit.c b/src/stdlib/exit.c
index 18ee086d..c9deba7a 100644
--- a/src/stdlib/exit.c
+++ b/src/stdlib/exit.c
@@ -1,7 +1,7 @@
#include <stdlib.h>
#include <limits.h>
#include <stddef.h>
-#include "stdio/_stdio.h"
+#include <stdio.h>
#include "_syscall.h"
#include "_stdlib.h"
@@ -10,7 +10,6 @@ _Noreturn void exit(int status)
{
long scno = __syscall_lookup(exit);
struct atexit *ae = &(__stdlib.atexit);
- size_t i;
/* execute all atexit() registered functions in reverse order */
while (ae) {
@@ -21,9 +20,7 @@ _Noreturn void exit(int status)
ae = ae->prev;
}
- for (i = 0; i < FOPEN_MAX; i++) {
- fclose(&(__stdio.FILES[i]));
- }
+ fflush(NULL);
for (;;) {
__syscall(scno, status);