(_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:20:49 +00:00
parent 29cd43d7a9
commit 6797b8a30f

View File

@ -159,7 +159,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;
_IO_unsave_markers(fp);