]> granicus.if.org Git - pdns/commitdiff
poll events are bitmasks, not values
authorPeter van Dijk <peter.van.dijk@powerdns.com>
Mon, 8 Apr 2019 12:06:05 +0000 (14:06 +0200)
committerPeter van Dijk <peter.van.dijk@powerdns.com>
Mon, 8 Apr 2019 12:06:05 +0000 (14:06 +0200)
pdns/pollmplexer.cc

index 8e3e8b1d3a054ba6e5857cec87f4686c74bab43d..edf53e45eebb0d806c2f85f30c2459da631d255b 100644 (file)
@@ -128,7 +128,7 @@ int PollFDMultiplexer::run(struct timeval* now, int timeout)
   d_inrun=true;
 
   for(const auto& pollfd : pollfds) {
-    if(pollfd.revents == POLLIN) {
+    if(pollfd.revents & POLLIN) {
       d_iter=d_readCallbacks.find(pollfd.fd);
     
       if(d_iter != d_readCallbacks.end()) {
@@ -136,7 +136,7 @@ int PollFDMultiplexer::run(struct timeval* now, int timeout)
         continue; // so we don't refind ourselves as writable!
       }
     }
-    else if(pollfd.revents == POLLOUT) {
+    else if(pollfd.revents & POLLOUT) {
       d_iter=d_writeCallbacks.find(pollfd.fd);
     
       if(d_iter != d_writeCallbacks.end()) {