]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/asio/detail/impl/pipe_select_interrupter.ipp
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / boost / boost / asio / detail / impl / pipe_select_interrupter.ipp
index f7bb7851b2ff6992c3b8280a5e1b5824b4b5b350..dfa461ba43859b01e7985c39221e816c8a193591 100644 (file)
@@ -2,7 +2,7 @@
 // detail/impl/pipe_select_interrupter.ipp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -102,12 +102,17 @@ bool pipe_select_interrupter::reset()
   {
     char data[1024];
     signed_size_type bytes_read = ::read(read_descriptor_, data, sizeof(data));
-    if (bytes_read < 0 && errno == EINTR)
+    if (bytes_read == sizeof(data))
       continue;
-    bool was_interrupted = (bytes_read > 0);
-    while (bytes_read == sizeof(data))
-      bytes_read = ::read(read_descriptor_, data, sizeof(data));
-    return was_interrupted;
+    if (bytes_read > 0)
+      return true;
+    if (bytes_read == 0)
+      return false;
+    if (errno == EINTR)
+      continue;
+    if (errno == EWOULDBLOCK || errno == EAGAIN)
+      return true;
+    return false;
   }
 }