From: Bert Hubert Date: Mon, 8 Oct 2007 07:14:16 +0000 (+0000) Subject: further fix for Solaris 10 starting to miss packets. Authored and tested by Alex... X-Git-Tag: rec-3.1.7.1~148 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=273d3305aa393ee8a77e5ae3a4d48c6d513f81b2;p=pdns further fix for Solaris 10 starting to miss packets. Authored and tested by Alex Kiernan. git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@1093 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- diff --git a/pdns/portsmplexer.cc b/pdns/portsmplexer.cc index daa5c7350..ab0cfebdb 100644 --- a/pdns/portsmplexer.cc +++ b/pdns/portsmplexer.cc @@ -91,10 +91,16 @@ int PortsFDMultiplexer::run(struct timeval* now) gettimeofday(now,0); - if(ret < 0) { - if(errno!=EINTR && errno!=ETIME) + /* 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 < 0 && errno!=ETIME) { + if(errno!=EINTR) throw FDMultiplexerException("completion port_getn returned error: "+stringerror()); - // EINTR and ETIME are not really errors + // EINTR is not really an error return 0; }