diff options
author | Rich Felker <dalias@aerifal.cx> | 2011-09-21 21:30:45 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2011-09-21 21:30:45 -0400 |
commit | ca52e347673126956a4f21247d8a551ea668f61f (patch) | |
tree | ca8a0e767640ca64fd91ab0d3edc75f24b269178 | |
parent | 319df20bc9c20231d8efd810780c012cbdcfb109 (diff) | |
download | musl-ca52e347673126956a4f21247d8a551ea668f61f.tar.gz |
avoid setting FILE lock count when not using flockfile
for now this is just a tiny optimization, but later if we support
cancellation from __stdio_read and __stdio_write, it will be necessary
for the recusrive lock count to be zero in order for these functions
to know they are responsible for unlocking the FILE on cancellation.
-rw-r--r-- | src/stdio/__lockfile.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/stdio/__lockfile.c b/src/stdio/__lockfile.c index 6ebf6202..3bf3c26b 100644 --- a/src/stdio/__lockfile.c +++ b/src/stdio/__lockfile.c @@ -8,7 +8,7 @@ int __lockfile(FILE *f) return 0; while ((owner = a_cas(&f->lock, 0, tid))) __wait(&f->lock, &f->waiters, owner, 1); - return f->lockcount = 1; + return 1; } void __unlockfile(FILE *f) |