]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Hopefully fix compilation on OpenIndiana
authorRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 4 Aug 2021 14:37:58 +0000 (16:37 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 4 Aug 2021 14:37:58 +0000 (16:37 +0200)
pdns/devpollmplexer.cc
pdns/epollmplexer.cc
pdns/kqueuemplexer.cc
pdns/portsmplexer.cc

index 715206d775e3ab90ac49752152c4ca3d1ae23d58..c73c03d28f04e5fb193759dea5224c81763ce140 100644 (file)
@@ -93,6 +93,7 @@ static int convertEventKind(FDMultiplexer::EventKind kind)
   case FDMultiplexer::EventKind::Both:
     return POLLIN | POLLOUT;
   }
+  throw std::runtime_error("Unhandled event kind in the /dev/poll multiplexer");
 }
 
 void DevPollFDMultiplexer::addFD(int fd, FDMultiplexer::EventKind kind)
index 88e58b7b784c2f5ced8b11feaa4bd2881b47c35b..dc060f13070d3e9332a2dd0dae57fddde838f322 100644 (file)
@@ -113,6 +113,8 @@ static uint32_t convertEventKind(FDMultiplexer::EventKind kind)
   case FDMultiplexer::EventKind::Both:
     return EPOLLIN | EPOLLOUT;
   }
+
+  throw std::runtime_error("Unhandled event kind in the epoll multiplexer");
 }
 
 void EpollFDMultiplexer::addFD(int fd, FDMultiplexer::EventKind kind)
index 447b45ea3bfa467aeafaadb20f1f9651a31207bc..da2fa1647c80d2fc08287f34885fd50e6db11eb8 100644 (file)
@@ -97,6 +97,8 @@ static uint32_t convertEventKind(FDMultiplexer::EventKind kind)
   case FDMultiplexer::EventKind::Both:
     throw std::runtime_error("Read and write events cannot be combined in one go with kqueue");
   }
+
+  throw std::runtime_error("Unhandled event kind in the kqueue multiplexer");
 }
 
 void KqueueFDMultiplexer::addFD(int fd, FDMultiplexer::EventKind kind)
index 2f3c945912eb60d6e50322526eb5fa865078d096..76ebdb1e0778dcc74cf74886f4fae469b0f644c3 100644 (file)
@@ -74,6 +74,7 @@ static int convertEventKind(FDMultiplexer::EventKind kind)
   case FDMultiplexer::EventKind::Both:
     return POLLIN | POLLOUT;
   }
+  throw std::runtime_error("Unhandled event kind in the ports multiplexer");
 }
 
 void PortsFDMultiplexer::addFD(int fd, FDMultiplexer::EventKind kind)
@@ -124,14 +125,14 @@ void PortsFDMultiplexer::getAvailableFDs(std::vector<int>& fds, int timeout)
     const auto fd = d_pevents[n].portev_object;
 
     /* we need to re-associate the FD */
-    if ((d_pevents[n].portev_events & POLLIN || d_pevents[n].portev_events & POLLER || d_pevents[n].portev_events & POLLHUP)) {
+    if ((d_pevents[n].portev_events & POLLIN || d_pevents[n].portev_events & POLLERR || d_pevents[n].portev_events & POLLHUP)) {
       if (d_readCallbacks.count(fd)) {
         if (port_associate(d_portfd, PORT_SOURCE_FD, fd, d_writeCallbacks.count(fd) > 0 ? POLLIN | POLLOUT : POLLIN, 0) < 0) {
           throw FDMultiplexerException("Unable to add fd back to ports (read): " + stringerror());
         }
       }
     }
-    else if ((d_pevents[n].portev_events & POLLOUT || d_pevents[n].portev_events & POLLER)) {
+    else if ((d_pevents[n].portev_events & POLLOUT || d_pevents[n].portev_events & POLLERR)) {
       if (d_writeCallbacks.count(fd)) {
         if (port_associate(d_portfd, PORT_SOURCE_FD, fd, d_readCallbacks.count(fd) > 0 ? POLLIN | POLLOUT : POLLOUT, 0) < 0) {
           throw FDMultiplexerException("Unable to add fd back to ports (write): " + stringerror());
@@ -182,7 +183,7 @@ int PortsFDMultiplexer::run(struct timeval* now, int timeout)
   d_inrun = true;
 
   for (unsigned int n = 0; n < numevents; ++n) {
-    if (d_pevents[n].portev_events & POLLIN || d_pevents[n].portev_events & POLLER || d_pevents[n].portev_events & POLLHUP) {
+    if (d_pevents[n].portev_events & POLLIN || d_pevents[n].portev_events & POLLERR || d_pevents[n].portev_events & POLLHUP) {
       const auto& iter = d_readCallbacks.find(d_pevents[n].portev_object);
       if (iter != d_readCallbacks.end()) {
         iter->d_callback(iter->d_fd, iter->d_parameter);
@@ -191,7 +192,7 @@ int PortsFDMultiplexer::run(struct timeval* now, int timeout)
         }
       }
     }
-    if (d_pevents[n].portev_events & POLLOUT || d_pevents[n].portev_events & POLLER) {
+    if (d_pevents[n].portev_events & POLLOUT || d_pevents[n].portev_events & POLLERR) {
       const auto& iter = d_writeCallbacks.find(d_pevents[n].portev_object);
       if (iter != d_writeCallbacks.end()) {
         iter->d_callback(iter->d_fd, iter->d_parameter);