From 0f30d227497418c6d3bef7d52244407e30454504 Mon Sep 17 00:00:00 2001 From: Kacper Date: Mon, 22 Dec 2025 23:27:56 +0100 Subject: Added c11 threads, fixed some locks and add *_unlocked functions --- lib/libc/stdio/clearerr.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'lib/libc/stdio/clearerr.c') diff --git a/lib/libc/stdio/clearerr.c b/lib/libc/stdio/clearerr.c index 02244466..8389a085 100644 --- a/lib/libc/stdio/clearerr.c +++ b/lib/libc/stdio/clearerr.c @@ -1,14 +1,9 @@ -#include "__stdio.h" // for __FILE, _IO_EOF, _IO_ERR -#include "stddef.h" // for NULL - -#include // for FILE, clearerr +#include <__stdio.h> +#include void clearerr(FILE *stream) { - struct __FILE *stream_impl = __FILE(stream); - - if (stream == NULL) - return; - - stream_impl->flags &= ~(_IO_ERR | _IO_EOF); + flockfile(stream); + clearerr_unlocked(stream); + funlockfile(stream); } -- cgit v1.2.3