Skip to content

Commit

Permalink
* basic_file_stdio.cc (__basic_file<char>::close): Don't flush stream
Browse files Browse the repository at this point in the history
	twice.  Always set _M_cfile to 0 when stream was open.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@65458 138bc75d-0d04-0410-961f-82ee72b054a4
  • Loading branch information
danglin committed Apr 11, 2003
1 parent 4dfab37 commit bd18ac9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions libstdc++-v3/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2003-04-10 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>

* basic_file_stdio.cc (__basic_file<char>::close): Don't flush stream
twice. Always set _M_cfile to 0 when stream was open.

2003-04-09 Benjamin Kosnik <bkoz@redhat.com>

Reshuffle 27_io testsuite. * testsuite/27_io/filebuf.cc,
Expand Down
12 changes: 6 additions & 6 deletions libstdc++-v3/config/io/basic_file_stdio.cc
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,12 @@ namespace std
__basic_file* __retval = static_cast<__basic_file*>(NULL);
if (this->is_open())
{
fflush(_M_cfile);
if ((_M_cfile_created && fclose(_M_cfile) == 0) || !_M_cfile_created)
{
_M_cfile = 0;
__retval = this;
}
if (_M_cfile_created)
fclose(_M_cfile);
else
fflush(_M_cfile);
_M_cfile = 0;
__retval = this;
}
return __retval;
}
Expand Down

0 comments on commit bd18ac9

Please sign in to comment.