summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '3rdParty/Boost/src/boost/asio/detail/pipe_select_interrupter.hpp')
-rw-r--r--3rdParty/Boost/src/boost/asio/detail/pipe_select_interrupter.hpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/3rdParty/Boost/src/boost/asio/detail/pipe_select_interrupter.hpp b/3rdParty/Boost/src/boost/asio/detail/pipe_select_interrupter.hpp
index 51b8c02..7f9e122 100644
--- a/3rdParty/Boost/src/boost/asio/detail/pipe_select_interrupter.hpp
+++ b/3rdParty/Boost/src/boost/asio/detail/pipe_select_interrupter.hpp
@@ -2,7 +2,7 @@
// pipe_select_interrupter.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2010 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)
@@ -79,12 +79,17 @@ public:
// Reset the select interrupt. Returns true if the call was interrupted.
bool reset()
{
- char data[1024];
- int bytes_read = ::read(read_descriptor_, data, sizeof(data));
- bool was_interrupted = (bytes_read > 0);
- while (bytes_read == sizeof(data))
- bytes_read = ::read(read_descriptor_, data, sizeof(data));
- return was_interrupted;
+ for (;;)
+ {
+ char data[1024];
+ int bytes_read = ::read(read_descriptor_, data, sizeof(data));
+ if (bytes_read < 0 && errno == EINTR)
+ continue;
+ bool was_interrupted = (bytes_read > 0);
+ while (bytes_read == sizeof(data))
+ bytes_read = ::read(read_descriptor_, data, sizeof(data));
+ return was_interrupted;
+ }
}
// Get the read descriptor to be passed to select.