summaryrefslogtreecommitdiff
path: root/lib/libc/stdlib/exit.c
diff options
context:
space:
mode:
authorKacper <kacper@mail.openlinux.dev>2025-12-09 23:14:53 +0100
committerKacper <kacper@mail.openlinux.dev>2025-12-09 23:14:53 +0100
commit169daa11155988a210fac949297381743f3cb400 (patch)
tree602ef5df5ae9ea075ab3d5dac3c8ad60da1ea2cc /lib/libc/stdlib/exit.c
parent4e2112e165fdd94dee58378e3ea32892f3710cd7 (diff)
feat: clang-tidy fixes
Diffstat (limited to 'lib/libc/stdlib/exit.c')
-rw-r--r--lib/libc/stdlib/exit.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/lib/libc/stdlib/exit.c b/lib/libc/stdlib/exit.c
index 5fea520e..7fc96f28 100644
--- a/lib/libc/stdlib/exit.c
+++ b/lib/libc/stdlib/exit.c
@@ -1,7 +1,10 @@
-#include <libc.h>
-#include <libc.h>
-#include <unistd.h>
-#include <stdio.h>
+#include "__stdio.h" // for __FILE
+#include "stddef.h" // for NULL
+
+#include <libc.h> // for weak_reference
+#include <stdio.h> // for fflush, stdout, FILE, stderr, stdin
+#include <stdlib.h> // for free, exit
+#include <unistd.h> // for _exit, close, write, STDERR_FILENO
void (*__dummy_atexit_fvec)(void);
weak_reference(__dummy_atexit_fvec, __atexit_fvec);
@@ -15,16 +18,16 @@ static void __fclose(FILE *stream)
return;
}
- if (__IMPL(stream)->buf_len > 0) {
+ if (__FILE(stream)->buf_len > 0) {
fflush(stream);
}
- if (__IMPL(stream)->fd > STDERR_FILENO) {
- close(__IMPL(stream)->fd);
+ if (__FILE(stream)->fd > STDERR_FILENO) {
+ close(__FILE(stream)->fd);
}
- if (__IMPL(stream)->buf) {
- free(__IMPL(stream)->buf);
+ if (__FILE(stream)->buf) {
+ free(__FILE(stream)->buf);
}
if (stream != stdout && stream != stderr && stream != stdin) {