From: Amos Jeffries Date: Thu, 7 Apr 2011 09:23:06 +0000 (+1200) Subject: Fix ModPoll signedness checks X-Git-Tag: take06~27^2~27 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=425e3a42da7c33555fd9201e2974183318ef88a7;p=thirdparty%2Fsquid.git Fix ModPoll signedness checks 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. --- diff --git a/src/comm/ModPoll.cc b/src/comm/ModPoll.cc index 095d0b56e4..d4a884d1e0 100644 --- a/src/comm/ModPoll.cc +++ b/src/comm/ModPoll.cc @@ -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))