Commit 8c0d7ddf authored by Mathieu Stefani's avatar Mathieu Stefani Committed by GitHub

Merge pull request #48 from RossRogers/master

Enables gdb debugging by fixing the polling code to allow interrupts.
parents 37807cea 5730236b
......@@ -187,7 +187,11 @@ namespace Polling {
Epoll::poll(std::vector<Event>& events, size_t maxEvents, std::chrono::milliseconds timeout) const {
struct epoll_event evs[Const::MaxEvents];
int ready_fds = epoll_wait(epoll_fd, evs, maxEvents, timeout.count());
int ready_fds = -1;
do {
ready_fds = epoll_wait(epoll_fd, evs, maxEvents, timeout.count());
} while (ready_fds < 0 && errno == EINTR);
if (ready_fds > 0) {
for (int i = 0; i < ready_fds; ++i) {
const struct epoll_event *ev = evs + i;
......
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