]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix ModPoll signedness checks
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 18 Apr 2011 11:48:02 +0000 (05:48 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 18 Apr 2011 11:48:02 +0000 (05:48 -0600)
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_poll.cc

index 9b00ea363130ab1df6450e13820a77dfd68fa12f..637901d563f16305ab7cb1d117e31368f93b1407 100644 (file)
@@ -402,7 +402,7 @@ comm_select(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
@@ -416,7 +416,7 @@ comm_select(int msec)
             ++statCounter.select_loops;
             PROF_stop(comm_poll_normal);
 
-            if (num >= 0 || npending >= 0)
+            if (num >= 0 || npending > 0)
                 break;
 
             if (ignoreErrno(errno))