diff options
Diffstat (limited to 'lib/libc/stdio/ferror.c')
| -rw-r--r-- | lib/libc/stdio/ferror.c | 14 |
1 files changed, 7 insertions, 7 deletions
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 <stdio.h> // for FILE, ferror +#include <stdio.h> 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; } |
