diff options
author | John David Anglin <dave.anglin@nrc-cnrc.gc.ca> | 2003-04-11 02:57:44 +0000 |
---|---|---|
committer | John David Anglin <danglin@gcc.gnu.org> | 2003-04-11 02:57:44 +0000 |
commit | e6670c79c78c657ab11b2f89ee0413492f17b92f (patch) | |
tree | c825d1bcab4804c66b3be739616e9496ba63630e /libstdc++-v3/config/io | |
parent | 6d9c4c8386f1d11605d1c383f68d118be6aeea18 (diff) | |
download | gcc-e6670c79c78c657ab11b2f89ee0413492f17b92f.tar.gz |
basic_file_stdio.cc (__basic_file<char>::close): Don't flush stream twice.
* basic_file_stdio.cc (__basic_file<char>::close): Don't flush stream
twice. Always set _M_cfile to 0 when stream was open.
From-SVN: r65458
Diffstat (limited to 'libstdc++-v3/config/io')
-rw-r--r-- | libstdc++-v3/config/io/basic_file_stdio.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libstdc++-v3/config/io/basic_file_stdio.cc b/libstdc++-v3/config/io/basic_file_stdio.cc index b2287b24f7f..7f9c18bf05a 100644 --- a/libstdc++-v3/config/io/basic_file_stdio.cc +++ b/libstdc++-v3/config/io/basic_file_stdio.cc @@ -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; } |