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/ferror.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lib/libc/stdio/ferror.c') diff --git a/lib/libc/stdio/ferror.c b/lib/libc/stdio/ferror.c index 5e4b8dc4..9391a44a 100644 --- a/lib/libc/stdio/ferror.c +++ b/lib/libc/stdio/ferror.c @@ -1,12 +1,12 @@ -#include "__stdio.h" // for __FILE, _IO_ERR -#include "stddef.h" // for NULL - -#include // for FILE, ferror +#include int ferror(FILE *stream) { - if (stream == NULL) - return 0; + int r; + + flockfile(stream); + r = ferror_unlocked(stream); + funlockfile(stream); - return (__FILE(stream)->flags & _IO_ERR) != 0; + return r; } -- cgit v1.2.3