author | Rich Felker <dalias@aerifal.cx> | 2011年07月30日 08:02:14 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2011年07月30日 08:02:14 -0400 |
commit | dba68bf98fc708cea4c478278c889fc7ad802b00 (patch) | |
tree | b90a55aaa51c72475cdb69efca7b9ddd37e50b2e /src/stdio/fputc.c | |
parent | 7683fceedebd98dda19b1a379b92406b64ce7f92 (diff) | |
download | musl-dba68bf98fc708cea4c478278c889fc7ad802b00.tar.gz |
-rw-r--r-- | src/stdio/fputc.c | 5 |
diff --git a/src/stdio/fputc.c b/src/stdio/fputc.c index 98d0a20a..6a144a54 100644 --- a/src/stdio/fputc.c +++ b/src/stdio/fputc.c @@ -2,9 +2,10 @@ int fputc(int c, FILE *f) { - FLOCK(f); + if (f->lock < 0 || !__lockfile(f)) + return putc_unlocked(c, f); c = putc_unlocked(c, f); - FUNLOCK(f); + __unlockfile(f); return c; } |