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/ftell.c | |
parent | 7683fceedebd98dda19b1a379b92406b64ce7f92 (diff) | |
download | musl-dba68bf98fc708cea4c478278c889fc7ad802b00.tar.gz |
-rw-r--r-- | src/stdio/ftell.c | 6 |
diff --git a/src/stdio/ftell.c b/src/stdio/ftell.c index aa1f5381..3904a1d8 100644 --- a/src/stdio/ftell.c +++ b/src/stdio/ftell.c @@ -3,10 +3,8 @@ off_t __ftello_unlocked(FILE *f) { off_t pos = f->seek(f, 0, SEEK_CUR); - if (pos < 0) { - FUNLOCK(f); - return pos; - } + if (pos < 0) return pos; + /* Adjust for data in buffer. */ return pos - (f->rend - f->rpos) + (f->wpos - f->wbase); } |