int __towrite(FILE *f)
{
f->mode |= f->mode-1;
- if (f->flags & (F_NOWR)) {
+ if (f->flags & F_NOWR) {
f->flags |= F_ERR;
return EOF;
}
return 0;
}
-/* Link flush-on-exit code iff any stdio write functions are linked. */
-void __fflush_on_exit()
+hidden void __towrite_needs_stdio_exit()
{
- fflush(0);
+ __stdio_exit_needed();
}