]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Fix compilation of the event ports multiplexer 12069/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 30 Sep 2022 08:55:19 +0000 (10:55 +0200)
committerPeter van Dijk <peter.van.dijk@powerdns.com>
Fri, 7 Oct 2022 10:40:24 +0000 (12:40 +0200)
Thanks to Jonathan Perkin for the patch!

(cherry picked from commit 7ea87a63ab48e938bdb8b73ebfde1ac6bc71704f)

pdns/portsmplexer.cc

index 61333ef434ec3d6644eb0f1f42709a71a9b55b0a..86605a363c49201d384b629360118c757efa1e46 100644 (file)
@@ -39,9 +39,9 @@ private:
   std::vector<port_event_t> d_pevents;
 };
 
-static FDMultiplexer* makePorts(unsigned int)
+static FDMultiplexer* makePorts(unsigned int maxEventsHint)
 {
-  return new PortsFDMultiplexer();
+  return new PortsFDMultiplexer(maxEventsHint);
 }
 
 static struct PortsRegisterOurselves
@@ -94,7 +94,7 @@ void PortsFDMultiplexer::getAvailableFDs(std::vector<int>& fds, int timeout)
   timeoutspec.tv_sec = timeout / 1000;
   timeoutspec.tv_nsec = (timeout % 1000) * 1000000;
   unsigned int numevents = 1;
-  int ret = port_getn(d_portfd, d_pevents.data(), min(PORT_MAX_LIST, d_pevents.size()), &numevents, &timeoutspec);
+  int ret = port_getn(d_portfd, d_pevents.data(), min(PORT_MAX_LIST, static_cast<int>(d_pevents.size())), &numevents, &timeoutspec);
 
   /* port_getn has an unusual API - (ret == -1, errno == ETIME) can
      mean partial success; you must check (*numevents) in this case
@@ -155,7 +155,7 @@ int PortsFDMultiplexer::run(struct timeval* now, int timeout)
   timeoutspec.tv_sec = timeout / 1000;
   timeoutspec.tv_nsec = (timeout % 1000) * 1000000;
   unsigned int numevents = 1;
-  int ret = port_getn(d_portfd, d_pevents.data(), min(PORT_MAX_LIST, d_pevents.size()), &numevents, &timeoutspec);
+  int ret = port_getn(d_portfd, d_pevents.data(), min(PORT_MAX_LIST, static_cast<int>(d_pevents.size())), &numevents, &timeoutspec);
 
   /* port_getn has an unusual API - (ret == -1, errno == ETIME) can
      mean partial success; you must check (*numevents) in this case