diff options
Diffstat (limited to 'libstdc++-v3/config/io')
-rw-r--r-- | libstdc++-v3/config/io/basic_file_stdio.cc | 14 | ||||
-rw-r--r-- | libstdc++-v3/config/io/basic_file_stdio.h | 4 |
2 files changed, 7 insertions, 11 deletions
diff --git a/libstdc++-v3/config/io/basic_file_stdio.cc b/libstdc++-v3/config/io/basic_file_stdio.cc index 3025de52061..e03e869d890 100644 --- a/libstdc++-v3/config/io/basic_file_stdio.cc +++ b/libstdc++-v3/config/io/basic_file_stdio.cc @@ -140,8 +140,7 @@ namespace std } __basic_file<char>* - __basic_file<char>::sys_open(int __fd, ios_base::openmode __mode, - bool __del) + __basic_file<char>::sys_open(int __fd, ios_base::openmode __mode) { __basic_file* __ret = NULL; int __p_mode = 0; @@ -151,12 +150,9 @@ namespace std _M_open_mode(__mode, __p_mode, __rw_mode, __c_mode); if (!this->is_open() && (_M_cfile = fdopen(__fd, __c_mode))) { - // Iff __del is true, then close will fclose the fd. - _M_cfile_created = __del; - + _M_cfile_created = true; if (__fd == 0) setvbuf(_M_cfile, reinterpret_cast<char*>(NULL), _IONBF, 0); - __ret = this; } return __ret; @@ -199,7 +195,7 @@ namespace std __basic_file<char>* __basic_file<char>::close() { - __basic_file* __retval = static_cast<__basic_file*>(NULL); + __basic_file* __ret = static_cast<__basic_file*>(NULL); if (this->is_open()) { if (_M_cfile_created) @@ -207,9 +203,9 @@ namespace std else fflush(_M_cfile); _M_cfile = 0; - __retval = this; + __ret = this; } - return __retval; + return __ret; } streamsize diff --git a/libstdc++-v3/config/io/basic_file_stdio.h b/libstdc++-v3/config/io/basic_file_stdio.h index 212ebbe8dc7..d6a06ead739 100644 --- a/libstdc++-v3/config/io/basic_file_stdio.h +++ b/libstdc++-v3/config/io/basic_file_stdio.h @@ -1,6 +1,6 @@ // Wrapper of C-language FILE struct -*- C++ -*- -// Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. +// Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -74,7 +74,7 @@ namespace std sys_open(__c_file* __file, ios_base::openmode); __basic_file* - sys_open(int __fd, ios_base::openmode __mode, bool __del); + sys_open(int __fd, ios_base::openmode __mode); __basic_file* close(); |