1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00
* 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:
Ulrich Drepper
2002-04-03 05:18:32 +00:00
parent 7a73a7e685
commit 3384a8d67c
4 changed files with 87 additions and 2 deletions

View File

@ -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);