Skip to content

Commit

Permalink
fix: these things shouldnt throw
Browse files Browse the repository at this point in the history
  • Loading branch information
braindigitalis committed Nov 22, 2024
1 parent 8bf9b8c commit 2dbcb65
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/dpp/socketengines/epoll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,7 @@ struct DPP_EXPORT socket_engine_epoll : public socket_engine_base {
std::unique_lock lock(fds_mutex);
ev.data.ptr = fds.find(e.fd)->second.get();
}
int i = epoll_ctl(epoll_handle, EPOLL_CTL_ADD, e.fd, &ev);
if (i < 0) {
throw dpp::connection_exception("Failed to register socket to epoll_ctl()");
}
return epoll_ctl(epoll_handle, EPOLL_CTL_ADD, e.fd, &ev) >= 0;
}
return r;
}
Expand All @@ -174,10 +171,7 @@ struct DPP_EXPORT socket_engine_epoll : public socket_engine_base {
std::unique_lock lock(fds_mutex);
ev.data.ptr = fds.find(e.fd)->second.get();
}
int i = epoll_ctl(epoll_handle, EPOLL_CTL_MOD, e.fd, &ev);
if (i < 0) {
throw dpp::connection_exception("Failed to modify socket with epoll_ctl()");
}
return epoll_ctl(epoll_handle, EPOLL_CTL_MOD, e.fd, &ev) >= 0;
}
return r;
}
Expand Down

0 comments on commit 2dbcb65

Please sign in to comment.