Skip to content

Commit

Permalink
Fix issues in Epoll
Browse files Browse the repository at this point in the history
  • Loading branch information
BonnyAD9 committed Jun 13, 2024
1 parent 7ba68bc commit ab7f0fb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions src/plugins/input/tcp/src/Epoll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,11 @@

namespace tcp_in {

using namespace std;

Epoll::Epoll() : m_fd(epoll_create(1)) {
if (!m_fd) {
const char *err_str;
ipx_strerror(errno, err_str);
throw runtime_error("Failed to create epoll: " + string(err_str));
throw std::runtime_error("Failed to create epoll: " + std::string(err_str));
}
}

Expand All @@ -43,7 +41,7 @@ void Epoll::add(int fd, void *data) {
if (epoll_ctl(m_fd.get(), EPOLL_CTL_ADD, fd, &ev) == -1) {
const char *err_str;
ipx_strerror(errno, err_str);
throw runtime_error("Failed to add to epoll: " + string(err_str));
throw std::runtime_error("Failed to add to epoll: " + std::string(err_str));
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/input/tcp/src/Epoll.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class Epoll {
* @param fd File descriptor to remove from the epoll.
* @return true on success, otherwise false
*/
inline bool remove(int fd) noexcept {
bool remove(int fd) noexcept {
return epoll_ctl(m_fd.get(), EPOLL_CTL_DEL, fd, nullptr) == 0;
}

Expand Down

0 comments on commit ab7f0fb

Please sign in to comment.