Move the initialization code to a general place instead of keeping it
specific to file-backed streams.
Fixes: 596a61cf6b (libio: Start to return errors when flushing fwrite's buffer [BZ #29459], 2025-01-28)
Reported-by: Florian Weimer <fweimer@redhat.com>
Reviewed-by: Arjun Shankar <arjun@redhat.com>
_IO_link_in (fp);
fp->file._fileno = -1;
- fp->file._total_written = 0;
}
/* External version of _IO_new_file_init_internal which switches off
stream. */
fp->_wide_data = (struct _IO_wide_data *) -1L;
fp->_freeres_list = NULL;
+ fp->_total_written = 0;
}
int