Received: by mail.netbsd.org (Postfix, from userid 605) id 20C6484ECE; Thu, 16 Apr 2020 13:09:30 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 9DA1F84EC4 for ; Thu, 16 Apr 2020 13:09:29 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([127.0.0.1]) by localhost (mail.netbsd.org [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id KtUWgLfxz9ge for ; Thu, 16 Apr 2020 13:09:29 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.NetBSD.org [IPv6:2001:470:a085:999:28c:faff:fe03:5984]) by mail.netbsd.org (Postfix) with ESMTP id D175F84D2D for ; Thu, 16 Apr 2020 13:09:28 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id C4A33FB27; Thu, 16 Apr 2020 13:09:28 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_1587042568113170" MIME-Version: 1.0 Date: Thu, 16 Apr 2020 13:09:28 +0000 From: "Jonathan Perkin" Subject: CVS commit: pkgsrc/net/powerdns-recursor To: pkgsrc-changes@NetBSD.org Reply-To: jperkin@netbsd.org X-Mailer: log_accum Message-Id: <20200416130928.C4A33FB27@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: pkgsrc-changes.NetBSD.org Precedence: bulk List-Unsubscribe: This is a multi-part message in MIME format. --_----------=_1587042568113170 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: jperkin Date: Thu Apr 16 13:09:28 UTC 2020 Modified Files: pkgsrc/net/powerdns-recursor: distinfo pkgsrc/net/powerdns-recursor/patches: patch-portsmplexer.cc Log Message: powerdns-recursor: Pull in upstream patch to fix SunOS. To generate a diff of this commit: cvs rdiff -u -r1.30 -r1.31 pkgsrc/net/powerdns-recursor/distinfo cvs rdiff -u -r1.1 -r1.2 \ pkgsrc/net/powerdns-recursor/patches/patch-portsmplexer.cc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --_----------=_1587042568113170 Content-Disposition: inline Content-Length: 5380 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii Modified files: Index: pkgsrc/net/powerdns-recursor/distinfo diff -u pkgsrc/net/powerdns-recursor/distinfo:1.30 pkgsrc/net/powerdns-recursor/distinfo:1.31 --- pkgsrc/net/powerdns-recursor/distinfo:1.30 Tue Mar 17 19:07:29 2020 +++ pkgsrc/net/powerdns-recursor/distinfo Thu Apr 16 13:09:28 2020 @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.30 2020/03/17 19:07:29 adam Exp $ +$NetBSD: distinfo,v 1.31 2020/04/16 13:09:28 jperkin Exp $ SHA1 (pdns-recursor-4.3.0.tar.bz2) = 8801c9ea575aa3bd88d793c252891d43ac529d31 RMD160 (pdns-recursor-4.3.0.tar.bz2) = 9da059ca48866b31c577ea6b5a5ffd0cf9a08842 @@ -7,6 +7,6 @@ Size (pdns-recursor-4.3.0.tar.bz2) = 134 SHA1 (patch-dns.hh) = 7e9c1b10a066a605b74ebdbee2d894aed50f6c68 SHA1 (patch-ext_json11_json11.cpp) = 2de8ea8b51556bd3e3c1a88f681697eff239ab1a SHA1 (patch-iputils.hh) = 9de7c58db7468da9fd2a175464becdbe339fac9d -SHA1 (patch-portsmplexer.cc) = b4d447d88d9f2a4e9c0dffb40a41a0e5fde7255a +SHA1 (patch-portsmplexer.cc) = 3e5232e0fc0a4e57aa74b6ebd594291598e7eb66 SHA1 (patch-qtype.hh) = f14eb9ad7efc7dd4a0ce220c1f93044ef69e99c2 SHA1 (patch-version.cc) = 26226a02198edd9d8890a5199ee5a8051334fe41 Index: pkgsrc/net/powerdns-recursor/patches/patch-portsmplexer.cc diff -u pkgsrc/net/powerdns-recursor/patches/patch-portsmplexer.cc:1.1 pkgsrc/net/powerdns-recursor/patches/patch-portsmplexer.cc:1.2 --- pkgsrc/net/powerdns-recursor/patches/patch-portsmplexer.cc:1.1 Tue Jan 2 12:23:55 2018 +++ pkgsrc/net/powerdns-recursor/patches/patch-portsmplexer.cc Thu Apr 16 13:09:28 2020 @@ -1,17 +1,93 @@ -$NetBSD: patch-portsmplexer.cc,v 1.1 2018/01/02 12:23:55 fhajny Exp $ +$NetBSD: patch-portsmplexer.cc,v 1.2 2020/04/16 13:09:28 jperkin Exp $ -Work around invalid cast to binary operator. +Pull in upstream patch from https://github.com/PowerDNS/pdns/pull/9031 ---- portsmplexer.cc.orig 2017-12-04 12:51:03.000000000 +0000 +--- portsmplexer.cc.orig 2020-04-16 12:54:40.155420464 +0000 +++ portsmplexer.cc -@@ -85,8 +85,8 @@ int PortsFDMultiplexer::run(struct timev +@@ -23,11 +23,12 @@ public: + close(d_portfd); + } + +- virtual int run(struct timeval* tv, int timeout=500); ++ virtual int run(struct timeval* tv, int timeout=500) override; ++ virtual void getAvailableFDs(std::vector& fds, int timeout) override; + +- virtual void addFD(callbackmap_t& cbmap, int fd, callbackfunc_t toDo, const boost::any& parameter, const struct timeval* ttd=nullptr); +- virtual void removeFD(callbackmap_t& cbmap, int fd); +- string getName() ++ virtual void addFD(callbackmap_t& cbmap, int fd, callbackfunc_t toDo, const boost::any& parameter, const struct timeval* ttd=nullptr) override; ++ virtual void removeFD(callbackmap_t& cbmap, int fd) override; ++ string getName() const override + { + return "solaris completion ports"; + } +@@ -78,6 +79,58 @@ void PortsFDMultiplexer::removeFD(callba + throw FDMultiplexerException("Removing fd from port set: "+stringerror()); + } + ++void PortsFDMultiplexer::getAvailableFDs(std::vector& fds, int timeout) ++{ ++ struct timespec timeoutspec; ++ timeoutspec.tv_sec = timeout / 1000; ++ timeoutspec.tv_nsec = (timeout % 1000) * 1000000; ++ unsigned int numevents = 1; ++ int ret = port_getn(d_portfd, d_pevents.get(), min(PORT_MAX_LIST, s_maxevents), &numevents, &timeoutspec); ++ ++ /* port_getn has an unusual API - (ret == -1, errno == ETIME) can ++ mean partial success; you must check (*numevents) in this case ++ and process anything in there, otherwise you'll never see any ++ events from that object again. We don't care about pure timeouts ++ (ret == -1, errno == ETIME, *numevents == 0) so we don't bother ++ with that case. */ ++ if (ret == -1 && errno != ETIME) { ++ if (errno != EINTR) { ++ throw FDMultiplexerException("completion port_getn returned error: " + stringerror()); ++ } ++ ++ // EINTR is not really an error ++ return; ++ } ++ ++ if (numevents == 0) { ++ // nothing ++ return; ++ } ++ ++ fds.reserve(numevents); ++ ++ for (unsigned int n = 0; n < numevents; ++n) { ++ const auto fd = d_pevents[n].portev_object; ++ ++ /* we need to re-associate the FD */ ++ if (d_readCallbacks.count(fd)) { ++ if (port_associate(d_portfd, PORT_SOURCE_FD, fd, POLLIN, 0) < 0) { ++ throw FDMultiplexerException("Unable to add fd back to ports (read): " + stringerror()); ++ } ++ } ++ else if (d_writeCallbacks.count(fd)) { ++ if (port_associate(d_portfd, PORT_SOURCE_FD, fd, POLLOUT, 0) < 0) { ++ throw FDMultiplexerException("Unable to add fd back to ports (write): " + stringerror()); ++ } ++ } else { ++ /* not registered, this is unexpected */ ++ continue; ++ } ++ ++ fds.push_back(fd); ++ } ++} ++ + int PortsFDMultiplexer::run(struct timeval* now, int timeout) + { + if(d_inrun) { +@@ -85,8 +138,8 @@ int PortsFDMultiplexer::run(struct timev } struct timespec timeoutspec; - timeoutspec.tv_sec = time / 1000; - timeoutspec.tv_nsec = (time % 1000) * 1000000; -+ timeoutspec.tv_sec = (intptr_t)time / 1000; -+ timeoutspec.tv_nsec = ((intptr_t)time % 1000) * 1000000; ++ timeoutspec.tv_sec = timeout / 1000; ++ timeoutspec.tv_nsec = (timeout % 1000) * 1000000; unsigned int numevents=1; int ret= port_getn(d_portfd, d_pevents.get(), min(PORT_MAX_LIST, s_maxevents), &numevents, &timeoutspec); --_----------=_1587042568113170--