From 2dbcb6528acb624e43c001afc2d78fa563679e41 Mon Sep 17 00:00:00 2001 From: Craig Edwards Date: Fri, 22 Nov 2024 13:26:31 +0000 Subject: [PATCH] fix: these things shouldnt throw --- src/dpp/socketengines/epoll.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/dpp/socketengines/epoll.cpp b/src/dpp/socketengines/epoll.cpp index 8bcf3671ec..cfde495d94 100644 --- a/src/dpp/socketengines/epoll.cpp +++ b/src/dpp/socketengines/epoll.cpp @@ -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; } @@ -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; }