]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
cleanup poll event bitmask vs. value usage in two more places
authorPeter van Dijk <peter.van.dijk@powerdns.com>
Mon, 8 Apr 2019 12:57:29 +0000 (14:57 +0200)
committerPeter van Dijk <peter.van.dijk@powerdns.com>
Mon, 8 Apr 2019 12:57:29 +0000 (14:57 +0200)
pdns/pollmplexer.cc
pdns/tcpreceiver.cc

index edf53e45eebb0d806c2f85f30c2459da631d255b..399ad132ae8a3bd6dca4d566d2ed03fa952584e4 100644 (file)
@@ -104,7 +104,7 @@ void PollFDMultiplexer::getAvailableFDs(std::vector<int>& 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);
     }
   }
index 706305c87aa718be343b0308dee1ce78b9383ade..9c0a7b80c11256ca94fd0f56833d20e51f7b64b0 100644 (file)
@@ -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();