From: Bert Hubert Date: Fri, 5 Mar 2010 13:43:59 +0000 (+0000) Subject: we probably overwrite the errno return from ports_getn now, which might generate... X-Git-Tag: rec-3.2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1c0af70dde4986c99c9a08f072e125bb5386dc29;p=pdns we probably overwrite the errno return from ports_getn now, which might generate spurious errors git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@1537 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- diff --git a/pdns/portsmplexer.cc b/pdns/portsmplexer.cc index f79260ac2..8d7eb7cb8 100644 --- a/pdns/portsmplexer.cc +++ b/pdns/portsmplexer.cc @@ -89,7 +89,7 @@ int PortsFDMultiplexer::run(struct timeval* now) unsigned int numevents=1; int ret= port_getn(d_portfd, d_pevents.get(), min(PORT_MAX_LIST, s_maxevents), &numevents, &timeout); - gettimeofday(now,0); + /* port_getn has an unusual API - (ret == -1, errno == ETIME) can mean partial success; you must check (*numevents) in this case @@ -101,9 +101,10 @@ int PortsFDMultiplexer::run(struct timeval* now) if(errno!=EINTR) throw FDMultiplexerException("completion port_getn returned error: "+stringerror()); // EINTR is not really an error + gettimeofday(now,0); return 0; } - + gettimeofday(now,0); if(!numevents) // nothing return 0;