aboutsummaryrefslogtreecommitdiff
path: root/newlib/libc/stdio/fgetc.c
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/stdio/fgetc.c')
-rw-r--r--newlib/libc/stdio/fgetc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/newlib/libc/stdio/fgetc.c b/newlib/libc/stdio/fgetc.c
index e275cfe..9837a2e 100644
--- a/newlib/libc/stdio/fgetc.c
+++ b/newlib/libc/stdio/fgetc.c
@@ -93,9 +93,11 @@ _DEFUN(fgetc, (fp),
#if !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__)
int result;
CHECK_INIT(_REENT, fp);
+ __sfp_lock_acquire ();
_flockfile (fp);
result = __sgetc_r (_REENT, fp);
_funlockfile (fp);
+ __sfp_lock_release ();
return result;
#else
return _fgetc_r (_REENT, fp);