]> granicus.if.org Git - pdns/commitdiff
further fix for Solaris 10 starting to miss packets. Authored and tested by Alex...
authorBert Hubert <bert.hubert@netherlabs.nl>
Mon, 8 Oct 2007 07:14:16 +0000 (07:14 +0000)
committerBert Hubert <bert.hubert@netherlabs.nl>
Mon, 8 Oct 2007 07:14:16 +0000 (07:14 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@1093 d19b8d6e-7fed-0310-83ef-9ca221ded41b

pdns/portsmplexer.cc

index daa5c735074520ac6ef9a0a79175785a67fa5039..ab0cfebdba3fa58c8217ead6aa3290d655fdc2df 100644 (file)
@@ -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;
   }