diff --git a/src/debug/HyprCtl.cpp b/src/debug/HyprCtl.cpp index 70b886f2..e212ed1c 100644 --- a/src/debug/HyprCtl.cpp +++ b/src/debug/HyprCtl.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include @@ -1784,13 +1785,17 @@ int hyprCtlFDTick(int fd, uint32_t mask, void* data) { std::array readBuffer; - fd_set fdset; - FD_ZERO(&fdset); - FD_SET(ACCEPTEDCONNECTION, &fdset); - timeval timeout = {.tv_sec = 0, .tv_usec = 5000}; - auto success = select(ACCEPTEDCONNECTION + 1, &fdset, nullptr, nullptr, &timeout); + // + pollfd pollfds[1] = { + { + .fd = ACCEPTEDCONNECTION, + .events = POLLIN, + }, + }; - if (success <= 0) { + int ret = poll(pollfds, 1, 5000); + + if (ret <= 0) { close(ACCEPTEDCONNECTION); return 0; }