From 169daa11155988a210fac949297381743f3cb400 Mon Sep 17 00:00:00 2001 From: Kacper Date: Tue, 9 Dec 2025 23:14:53 +0100 Subject: feat: clang-tidy fixes --- lib/libc/stdlib/exit.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'lib/libc/stdlib/exit.c') 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 -#include -#include -#include +#include "__stdio.h" // for __FILE +#include "stddef.h" // for NULL + +#include // for weak_reference +#include // for fflush, stdout, FILE, stderr, stdin +#include // for free, exit +#include // 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) { -- cgit v1.2.3