]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix ModPoll signedness checks
authorAmos Jeffries <squid3@treenet.co.nz>
Thu, 7 Apr 2011 09:23:06 +0000 (21:23 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 7 Apr 2011 09:23:06 +0000 (21:23 +1200)
This npending test bug was preventing any poll() errors from being
noticed and displayed. Possibly leading to some of the weird hanging
reports we have been unable to replicate.

src/comm/ModPoll.cc

index 095d0b56e4df65894639843f08e6676ff5d20335..d4a884d1e03a5c9d4a9ab232d748d2df07477567 100644 (file)
@@ -414,7 +414,7 @@ Comm::DoSelect(int msec)
          * Note that this will only ever trigger when there are no log files
          * and stdout/err/in are all closed too.
          */
-        if (nfds == 0 && !npending) {
+        if (nfds == 0 && npending == 0) {
             if (shutting_down)
                 return COMM_SHUTDOWN;
             else
@@ -428,7 +428,7 @@ Comm::DoSelect(int msec)
             ++statCounter.select_loops;
             PROF_stop(comm_poll_normal);
 
-            if (num >= 0 || npending >= 0)
+            if (num >= 0 || npending > 0)
                 break;
 
             if (ignoreErrno(errno))