diff options
Diffstat (limited to 'src/stdio/fgetc.c')
-rw-r--r-- | src/stdio/fgetc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/stdio/fgetc.c b/src/stdio/fgetc.c index da638684..4d8aca37 100644 --- a/src/stdio/fgetc.c +++ b/src/stdio/fgetc.c @@ -3,9 +3,10 @@ int fgetc(FILE *f) { int c; - FLOCK(f); + if (f->lock < 0 || !__lockfile(f)) + return getc_unlocked(f); c = getc_unlocked(f); - FUNLOCK(f); + __unlockfile(f); return c; } |