mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
Update.
* libio/bug-ungetwc1.c: New file. * libio/Makefile (tests): Add bug-ungetwc1. * libio/fileops.c (_IO_new_file_close_it): Only call _IO_do_flush if stream was last used for writing.
This commit is contained in:
@ -161,7 +161,11 @@ _IO_new_file_close_it (fp)
|
||||
if (!_IO_file_is_open (fp))
|
||||
return EOF;
|
||||
|
||||
write_status = _IO_do_flush (fp);
|
||||
if ((fp->_flags & _IO_NO_WRITES) == 0
|
||||
&& (fp->_flags & _IO_CURRENTLY_PUTTING) != 0)
|
||||
write_status = _IO_do_flush (fp);
|
||||
else
|
||||
write_status = 0;
|
||||
|
||||
INTUSE(_IO_unsave_markers) (fp);
|
||||
|
||||
|
Reference in New Issue
Block a user