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. */
-int (*const __fflush_on_exit)(FILE *) = fflush;
+hidden void __towrite_needs_stdio_exit()
+{
+ __stdio_exit_needed();
+}