diff options
Diffstat (limited to 'libio/fgetc.c')
-rw-r--r-- | libio/fgetc.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libio/fgetc.c b/libio/fgetc.c index 19c0a58..2aaea05 100644 --- a/libio/fgetc.c +++ b/libio/fgetc.c @@ -29,6 +29,10 @@ int fgetc (fp) FILE *fp; { + int result; CHECK_FILE (fp, EOF); - return _IO_getc (fp); + flockfile (fp); + result = _IO_getc_unlocked (fp); + funlockfile (fp); + return result; } |