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/getc.c')
-rw-r--r--newlib/libc/stdio/getc.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/newlib/libc/stdio/getc.c b/newlib/libc/stdio/getc.c
index 4b2509737..f7a2cac5a 100644
--- a/newlib/libc/stdio/getc.c
+++ b/newlib/libc/stdio/getc.c
@@ -74,7 +74,10 @@ int
getc (fp)
register FILE *fp;
{
+ int result;
+ _flockfile(fp);
/* CHECK_INIT is called (eventually) by __srefill. */
-
- return __sgetc (fp);
+ result = __sgetc (fp);
+ _funlockfile(fp);
+ return result;
}