summaryrefslogtreecommitdiff
path: root/lib/libc/stdlib/exit.c
diff options
context:
space:
mode:
authorKacper <kacper@mail.openlinux.dev>2025-12-09 21:17:12 +0100
committerKacper <kacper@mail.openlinux.dev>2025-12-09 21:17:12 +0100
commitb5cd18739a64c8d923a55b61c89ae3900faafd84 (patch)
treed192f7b25257ae9a8a4760c68f5314dcbc0d9b91 /lib/libc/stdlib/exit.c
parent119aed5bc787ccbf23d2f151759ec1f3a80977e1 (diff)
Fix include paths and formatting inconsistencies
Diffstat (limited to 'lib/libc/stdlib/exit.c')
-rw-r--r--lib/libc/stdlib/exit.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/libc/stdlib/exit.c b/lib/libc/stdlib/exit.c
index 34b8a0f2..5fea520e 100644
--- a/lib/libc/stdlib/exit.c
+++ b/lib/libc/stdlib/exit.c
@@ -1,4 +1,4 @@
-#include <io.h>
+#include <libc.h>
#include <libc.h>
#include <unistd.h>
#include <stdio.h>
@@ -9,26 +9,26 @@ weak_reference(__dummy_atexit_fvec, __atexit_fvec);
void (*__dummy_stdio_cleanup)(void);
weak_reference(__dummy_stdio_cleanup, __stdio_cleanup);
-static void __fclose(FILE *fp)
+static void __fclose(FILE *stream)
{
- if (fp == NULL) {
+ if (stream == NULL) {
return;
}
- if (fp->buf_len > 0) {
- fflush(fp);
+ if (__IMPL(stream)->buf_len > 0) {
+ fflush(stream);
}
- if (fp->fd > STDERR_FILENO) {
- close(fp->fd);
+ if (__IMPL(stream)->fd > STDERR_FILENO) {
+ close(__IMPL(stream)->fd);
}
- if (fp->buf) {
- free(fp->buf);
+ if (__IMPL(stream)->buf) {
+ free(__IMPL(stream)->buf);
}
- if (fp != stdout && fp != stderr && fp != stdin) {
- free(fp);
+ if (stream != stdout && stream != stderr && stream != stdin) {
+ free(stream);
}
}