aboutsummaryrefslogtreecommitdiff
path: root/libio/ferror.c
diff options
context:
space:
mode:
Diffstat (limited to 'libio/ferror.c')
-rw-r--r--libio/ferror.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libio/ferror.c b/libio/ferror.c
index 01e3bd8e2b..d10fcd9fff 100644
--- a/libio/ferror.c
+++ b/libio/ferror.c
@@ -32,6 +32,8 @@ _IO_ferror (_IO_FILE *fp)
{
int result;
CHECK_FILE (fp, EOF);
+ if (!_IO_need_lock (fp))
+ return _IO_ferror_unlocked (fp);
_IO_flockfile (fp);
result = _IO_ferror_unlocked (fp);
_IO_funlockfile (fp);