From: Remi Gacogne Date: Fri, 30 Sep 2022 08:55:19 +0000 (+0200) Subject: Fix compilation of the event ports multiplexer X-Git-Tag: auth-4.7.0~2^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9e0a436d92d23efaf32ad9251f29f7b64d94e317;p=thirdparty%2Fpdns.git Fix compilation of the event ports multiplexer Thanks to Jonathan Perkin for the patch! (cherry picked from commit 7ea87a63ab48e938bdb8b73ebfde1ac6bc71704f) --- diff --git a/pdns/portsmplexer.cc b/pdns/portsmplexer.cc index 61333ef434..86605a363c 100644 --- a/pdns/portsmplexer.cc +++ b/pdns/portsmplexer.cc @@ -39,9 +39,9 @@ private: std::vector 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& 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(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(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