Commit 7a9612ad authored by rakshasa's avatar rakshasa

Fixed error handling of E_INTR in poll_*.

parent 4279f3a7
......@@ -213,8 +213,13 @@ PollEPoll::do_poll(int64_t timeout_usec, int flags) {
thread_base::acquire_global_lock();
}
if (status == -1 && rak::error_number::current().value() != rak::error_number::e_intr)
throw std::runtime_error("Poll::work(): " + std::string(rak::error_number::current().c_str()));
if (status == -1) {
if (rak::error_number::current().value() != rak::error_number::e_intr) {
throw std::runtime_error("PollEPoll::work(): " + std::string(rak::error_number::current().c_str()));
}
return 0;
}
return perform();
}
......
......@@ -272,8 +272,13 @@ PollKQueue::do_poll(int64_t timeout_usec, int flags) {
thread_base::acquire_global_lock();
}
if (status == -1 && rak::error_number::current().value() != rak::error_number::e_intr)
throw std::runtime_error("Poll::work(): " + std::string(rak::error_number::current().c_str()));
if (status == -1) {
if (rak::error_number::current().value() != rak::error_number::e_intr) {
throw std::runtime_error("PollKQueue::work(): " + std::string(rak::error_number::current().c_str()));
}
return 0;
}
return perform();
}
......
......@@ -254,8 +254,13 @@ PollSelect::do_poll(int64_t timeout_usec, int flags) {
thread_base::acquire_global_lock();
}
if (status == -1 && rak::error_number::current().value() != rak::error_number::e_intr)
throw std::runtime_error("Poll::work(): " + std::string(rak::error_number::current().c_str()));
if (status == -1) {
if (rak::error_number::current().value() != rak::error_number::e_intr) {
throw std::runtime_error("PollSelect::work(): " + std::string(rak::error_number::current().c_str()));
}
return 0;
}
return perform(read_set, write_set, error_set);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment