libstdc++: Don't try to fflush stdin in gcc.old libstdc++ either.
PR lib/58206 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114879
This commit is contained in:
parent
44dc91bb82
commit
721b426c77
|
@ -190,7 +190,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
|||
{ this->close(); }
|
||||
|
||||
__basic_file<char>*
|
||||
__basic_file<char>::sys_open(__c_file* __file, ios_base::openmode)
|
||||
__basic_file<char>::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)
|
||||
|
|
Loading…
Reference in New Issue