X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Futil.cpp;h=1f2bc0565cab86b62478fb9894192cc4f3292123;hb=add2152e7561ea456068dd73ebbdc480d13e1015;hp=183793651635f3038863144a2e6e30a47b957416;hpb=04540dd41d0b3c1fad72b3074c0511dadc947657;p=staging%2Fwindowmanager.git diff --git a/src/util.cpp b/src/util.cpp index 1837936..1f2bc05 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -24,28 +24,6 @@ #include -void Poller::add_fd(int fd, std::function handler) { - pfds.emplace_back(pollfd{.fd = fd, .events = POLLIN, .revents = 0}); - handlers.emplace_back(std::move(handler)); -} - -int Poller::check_events() { - int ret = 0; - if ((ret = poll(this->pfds.data(), this->pfds.size(), -1)) != -1 && - errno != EINTR) { - for (unsigned i = 0; i < pfds.size(); i++) { - if ((pfds[i].revents & POLLIN) != 0) { - if (handlers[i](pfds[i].fd) == -1) { - return -1; - } - pfds[i].revents = 0; - pfds[i].events = POLLIN; - } - } - } - return ret; -} - unique_fd::~unique_fd() { if (this->fd != -1) { close(this->fd);