From: hno <> Date: Sat, 1 Sep 2007 19:09:59 +0000 (+0000) Subject: Clean up use of USE_POLL/HAVE_POLL X-Git-Tag: SQUID_3_0_RC1~74 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7d63e639a5836e294ab79f042dd6a3ad0e11f039;p=thirdparty%2Fsquid.git Clean up use of USE_POLL/HAVE_POLL USE_POLL == configure selected poll() for the select loop HAVE_POLL == configure detected that the system have a poll() call --- diff --git a/src/comm_poll.cc b/src/comm_poll.cc index 9ec5290bcb..b6d9354027 100644 --- a/src/comm_poll.cc +++ b/src/comm_poll.cc @@ -1,6 +1,6 @@ /* - * $Id: comm_poll.cc,v 1.23 2007/06/10 12:13:31 hno Exp $ + * $Id: comm_poll.cc,v 1.24 2007/09/01 13:09:59 hno Exp $ * * DEBUG: section 5 Socket Functions * @@ -216,7 +216,7 @@ comm_check_incoming_poll_handlers(int nfds, int *fds) } getCurrentTime(); - statCounter.syscalls.polls++; + statCounter.syscalls.selects++; if (poll(pfds, npfds, 0) < 1) { PROF_stop(comm_check_incoming); @@ -406,7 +406,7 @@ comm_select(int msec) for (;;) { PROF_start(comm_poll_normal); - statCounter.syscalls.polls++; + statCounter.syscalls.selects++; num = poll(pfds, nfds, msec); statCounter.select_loops++; PROF_stop(comm_poll_normal); diff --git a/src/squid.h b/src/squid.h index 0845b09b3f..3213167ed1 100644 --- a/src/squid.h +++ b/src/squid.h @@ -1,6 +1,6 @@ /* - * $Id: squid.h,v 1.266 2007/08/17 18:56:31 serassio Exp $ + * $Id: squid.h,v 1.267 2007/09/01 13:09:59 hno Exp $ * * AUTHOR: Duane Wessels * @@ -186,13 +186,11 @@ using namespace Squid; * -- Oskar Pearson * -- Stewart Forster */ -#if HAVE_POLL +#if USE_POLL #if HAVE_POLL_H #include -#else /* HAVE_POLL_H */ -#undef HAVE_POLL #endif /* HAVE_POLL_H */ -#endif /* HAVE_POLL */ +#endif /* USE_POLL */ /* * Filedescriptor limits in the different select loops @@ -352,7 +350,7 @@ extern "C" #endif /* Needed for poll() on Linux at least */ -#if HAVE_POLL +#if USE_POLL #ifndef POLLRDNORM #define POLLRDNORM POLLIN #endif diff --git a/src/stat.cc b/src/stat.cc index 02bfc12bf4..dcb46d13ba 100644 --- a/src/stat.cc +++ b/src/stat.cc @@ -1,5 +1,5 @@ /* - * $Id: stat.cc,v 1.408 2007/08/13 17:20:51 hno Exp $ + * $Id: stat.cc,v 1.409 2007/09/01 13:09:59 hno Exp $ * * DEBUG: section 18 Cache Manager Statistics * AUTHOR: Harvest Derived @@ -985,11 +985,8 @@ statAvgDump(StoreEntry * sentry, int minutes, int hours) XAVG(aborted_requests)); #if USE_POLL - - storeAppendPrintf(sentry, "syscalls.polls = %f/sec\n", XAVG(syscalls.polls)); -#endif -#if defined(USE_SELECT) || defined(USE_SELECT_WIN32) - + storeAppendPrintf(sentry, "syscalls.polls = %f/sec\n", XAVG(syscalls.selects)); +#elif defined(USE_SELECT) || defined(USE_SELECT_WIN32) storeAppendPrintf(sentry, "syscalls.selects = %f/sec\n", XAVG(syscalls.selects)); #endif diff --git a/src/structs.h b/src/structs.h index 58400f033b..73bc70263b 100644 --- a/src/structs.h +++ b/src/structs.h @@ -1,6 +1,6 @@ /* - * $Id: structs.h,v 1.562 2007/09/01 05:56:37 amosjeffries Exp $ + * $Id: structs.h,v 1.563 2007/09/01 13:09:59 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -1569,14 +1569,7 @@ struct _StatCounters } sock; -#if HAVE_POLL - - int polls; -#else - int selects; -#endif - } syscalls;