diff options
Diffstat (limited to 'newlib/libc/stdio/getc.c')
-rw-r--r-- | newlib/libc/stdio/getc.c | 7 |
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; } |