PR65411 don't retry fclose on EINTR
PR libstdc++/65411 * config/io/basic_file_stdio.cc (__basic_file<char>::close()): Don't retry fclose on EINTR. From-SVN: r244451
This commit is contained in:
parent
e3017e522a
commit
0fdba3a81c
|
@ -1,5 +1,9 @@
|
||||||
2017-01-13 Jonathan Wakely <jwakely@redhat.com>
|
2017-01-13 Jonathan Wakely <jwakely@redhat.com>
|
||||||
|
|
||||||
|
PR libstdc++/65411
|
||||||
|
* config/io/basic_file_stdio.cc (__basic_file<char>::close()): Don't
|
||||||
|
retry fclose on EINTR.
|
||||||
|
|
||||||
* include/profile/base.h: Remove unused header that leads to header
|
* include/profile/base.h: Remove unused header that leads to header
|
||||||
cycle in C++17 mode.
|
cycle in C++17 mode.
|
||||||
|
|
||||||
|
|
|
@ -267,16 +267,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||||
{
|
{
|
||||||
int __err = 0;
|
int __err = 0;
|
||||||
if (_M_cfile_created)
|
if (_M_cfile_created)
|
||||||
{
|
__err = fclose(_M_cfile);
|
||||||
// In general, no need to zero errno in advance if checking
|
|
||||||
// for error first. However, C89/C99 (at variance with IEEE
|
|
||||||
// 1003.1, f.i.) do not mandate that fclose must set errno
|
|
||||||
// upon error.
|
|
||||||
errno = 0;
|
|
||||||
do
|
|
||||||
__err = fclose(_M_cfile);
|
|
||||||
while (__err && errno == EINTR);
|
|
||||||
}
|
|
||||||
_M_cfile = 0;
|
_M_cfile = 0;
|
||||||
if (!__err)
|
if (!__err)
|
||||||
__ret = this;
|
__ret = this;
|
||||||
|
|
Loading…
Reference in New Issue