mirror of git://git.musl-libc.org/musl
minor cleanup in fflush
This commit is contained in:
parent
2499cd9d9b
commit
ca8a4e7fbd
|
@ -25,7 +25,6 @@ weak_alias(dummy, __stdout_used);
|
||||||
int fflush(FILE *f)
|
int fflush(FILE *f)
|
||||||
{
|
{
|
||||||
int r;
|
int r;
|
||||||
FILE *next;
|
|
||||||
|
|
||||||
if (f) {
|
if (f) {
|
||||||
FLOCK(f);
|
FLOCK(f);
|
||||||
|
@ -37,12 +36,9 @@ int fflush(FILE *f)
|
||||||
r = __stdout_used ? fflush(__stdout_used) : 0;
|
r = __stdout_used ? fflush(__stdout_used) : 0;
|
||||||
|
|
||||||
OFLLOCK();
|
OFLLOCK();
|
||||||
for (f=libc.ofl_head; f; f=next) {
|
for (f=libc.ofl_head; f; f=f->next) {
|
||||||
FLOCK(f);
|
FLOCK(f);
|
||||||
//OFLUNLOCK();
|
|
||||||
if (f->wpos > f->wbase) r |= __fflush_unlocked(f);
|
if (f->wpos > f->wbase) r |= __fflush_unlocked(f);
|
||||||
//OFLLOCK();
|
|
||||||
next = f->next;
|
|
||||||
FUNLOCK(f);
|
FUNLOCK(f);
|
||||||
}
|
}
|
||||||
OFLUNLOCK();
|
OFLUNLOCK();
|
||||||
|
|
Loading…
Reference in New Issue