Skip to content
Snippets Groups Projects
Commit e29a4436 authored by Eric Cano's avatar Eric Cano
Browse files

Added support to EINTR error in main process.

This allows attaching a debugger to the main process.
parent cb418f34
No related branches found
Tags v0.0-186
No related merge requests found
......@@ -277,6 +277,8 @@ void ProcessManager::runEventLoop() {
const int eventSlotCount = 5;
::epoll_event ee[eventSlotCount];
int receivedEvents = ::epoll_wait(m_epollFd, ee, eventSlotCount, nextTimeoutMs);
// epoll_wait can get interrupted by signal (like while debugging). This is should not be treated as an error.
if (-1 == receivedEvents && EINTR == errno) receivedEvents = 0;
cta::exception::Errnum::throwOnMinusOne(receivedEvents,
"In ProcessManager::run(): failed to ::epoll_wait()");
for (int i=0; i< receivedEvents; i++) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment