PR65411 don't retry fclose on EINTR
authorJonathan Wakely <jwakely@redhat.com>
Fri, 13 Jan 2017 17:52:34 +0000 (17:52 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Fri, 13 Jan 2017 17:52:34 +0000 (17:52 +0000)
PR libstdc++/65411
* config/io/basic_file_stdio.cc (__basic_file<char>::close()): Don't
retry fclose on EINTR.

From-SVN: r244451

libstdc++-v3/ChangeLog
libstdc++-v3/config/io/basic_file_stdio.cc

index 79dc7537537f76d69fb9ee3c6782612f3ecdd4ff..7ebd063df2a43963d000510a58ee7d33ea3388c2 100644 (file)
@@ -1,5 +1,9 @@
 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
        cycle in C++17 mode.
 
index a0ad82c75fb47aa396108f9b42dfb9ccfb54c724..e7367016504f58596b887e4018840a35cc4e0e63 100644 (file)
@@ -267,16 +267,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       {
        int __err = 0;
        if (_M_cfile_created)
-         {
-           // 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);
-         }
+         __err = fclose(_M_cfile);
        _M_cfile = 0;
        if (!__err)
          __ret = this;