From c1ee10a6c29d2eede49bf214b80a08d29ae05fc8 Mon Sep 17 00:00:00 2001 From: Peter van Dijk Date: Mon, 8 Apr 2019 14:57:29 +0200 Subject: [PATCH] cleanup poll event bitmask vs. value usage in two more places --- pdns/pollmplexer.cc | 2 +- pdns/tcpreceiver.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pdns/pollmplexer.cc b/pdns/pollmplexer.cc index edf53e45ee..399ad132ae 100644 --- a/pdns/pollmplexer.cc +++ b/pdns/pollmplexer.cc @@ -104,7 +104,7 @@ void PollFDMultiplexer::getAvailableFDs(std::vector& fds, int timeout) throw FDMultiplexerException("poll returned error: " + stringerror()); for(const auto& pollfd : pollfds) { - if (pollfd.revents == POLLIN || pollfd.revents == POLLOUT) { + if (pollfd.revents & POLLIN || pollfd.revents & POLLOUT) { fds.push_back(pollfd.fd); } } diff --git a/pdns/tcpreceiver.cc b/pdns/tcpreceiver.cc index 706305c87a..9c0a7b80c1 100644 --- a/pdns/tcpreceiver.cc +++ b/pdns/tcpreceiver.cc @@ -1352,7 +1352,7 @@ void TCPNameserver::thread() int sock=-1; for(const pollfd& pfd : d_prfds) { - if(pfd.revents == POLLIN) { + if(pfd.revents & POLLIN) { sock = pfd.fd; remote.sin4.sin_family = AF_INET6; addrlen=remote.getSocklen(); -- 2.47.2