Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/stdio/fgetc.c')
-rw-r--r--newlib/libc/stdio/fgetc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/newlib/libc/stdio/fgetc.c b/newlib/libc/stdio/fgetc.c
index 3d3d2c4ed..1160b67a7 100644
--- a/newlib/libc/stdio/fgetc.c
+++ b/newlib/libc/stdio/fgetc.c
@@ -42,5 +42,9 @@ int
_DEFUN (fgetc, (fp),
FILE * fp)
{
- return __sgetc (fp);
+ int result;
+ _flockfile(fp);
+ result = __sgetc (fp);
+ _funlockfile(fp);
+ return result;
}