diff --git a/external/gpl3/gcc.old/dist/libstdc++-v3/config/io/basic_file_stdio.cc b/external/gpl3/gcc.old/dist/libstdc++-v3/config/io/basic_file_stdio.cc index ba830fb9e97d..a6c9a4e249d2 100644 --- a/external/gpl3/gcc.old/dist/libstdc++-v3/config/io/basic_file_stdio.cc +++ b/external/gpl3/gcc.old/dist/libstdc++-v3/config/io/basic_file_stdio.cc @@ -190,7 +190,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { this->close(); } __basic_file* - __basic_file::sys_open(__c_file* __file, ios_base::openmode) + __basic_file::sys_open(__c_file* __file, ios_base::openmode __mode) { __basic_file* __ret = NULL; if (!this->is_open() && __file) @@ -199,7 +199,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // POSIX guarantees that fflush sets errno on error, but C doesn't. errno = 0; do - __err = fflush(__file); + __err = (__mode == std::ios_base::in ? 0 : fflush(__file)); while (__err && errno == EINTR); errno = __save_errno; if (!__err)