mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-26 04:45:58 +01:00
parent
236150b3c5
commit
b98e0876d3
1 changed files with 11 additions and 6 deletions
|
@ -11,6 +11,7 @@
|
||||||
#include <sys/utsname.h>
|
#include <sys/utsname.h>
|
||||||
#include <sys/un.h>
|
#include <sys/un.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <sys/poll.h>
|
||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
@ -1784,13 +1785,17 @@ int hyprCtlFDTick(int fd, uint32_t mask, void* data) {
|
||||||
|
|
||||||
std::array<char, 1024> readBuffer;
|
std::array<char, 1024> readBuffer;
|
||||||
|
|
||||||
fd_set fdset;
|
//
|
||||||
FD_ZERO(&fdset);
|
pollfd pollfds[1] = {
|
||||||
FD_SET(ACCEPTEDCONNECTION, &fdset);
|
{
|
||||||
timeval timeout = {.tv_sec = 0, .tv_usec = 5000};
|
.fd = ACCEPTEDCONNECTION,
|
||||||
auto success = select(ACCEPTEDCONNECTION + 1, &fdset, nullptr, nullptr, &timeout);
|
.events = POLLIN,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
if (success <= 0) {
|
int ret = poll(pollfds, 1, 5000);
|
||||||
|
|
||||||
|
if (ret <= 0) {
|
||||||
close(ACCEPTEDCONNECTION);
|
close(ACCEPTEDCONNECTION);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue