f->wpos = f->wbase = f->wend = 0;
f->rpos = f->rend = 0;
- /* Hook for special behavior on flush */
- if (f->flush) f->flush(f);
-
return 0;
}
int fflush(FILE *f)
{
int r;
- FILE *next;
if (f) {
FLOCK(f);
r = __stdout_used ? fflush(__stdout_used) : 0;
OFLLOCK();
- for (f=libc.ofl_head; f; f=next) {
+ for (f=libc.ofl_head; f; f=f->next) {
FLOCK(f);
- //OFLUNLOCK();
if (f->wpos > f->wbase) r |= __fflush_unlocked(f);
- //OFLLOCK();
- next = f->next;
FUNLOCK(f);
}
OFLUNLOCK();