]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Clean up use of USE_POLL/HAVE_POLL
authorhno <>
Sat, 1 Sep 2007 19:09:59 +0000 (19:09 +0000)
committerhno <>
Sat, 1 Sep 2007 19:09:59 +0000 (19:09 +0000)
USE_POLL == configure selected poll() for the select loop

HAVE_POLL == configure detected that the system have a poll() call

src/comm_poll.cc
src/squid.h
src/stat.cc
src/structs.h

index 9ec5290bcbbf11d25749f3e3c2b4df3bdcc505a2..b6d93540275a7426a8a9cfa64cb3942361c8f972 100644 (file)
@@ -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);
index 0845b09b3ff5576d943c617eb1bdf8a897decf1a..3213167ed110698bcf6afc53e4abaee0db34a744 100644 (file)
@@ -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 <oskar@is.co.za>
  *  -- Stewart Forster <slf@connect.com.au>
  */
-#if HAVE_POLL
+#if USE_POLL
 #if HAVE_POLL_H
 #include <poll.h>
-#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
index 02bfc12bf4ee4b6ecead0ce6942a357dfcf57c5c..dcb46d13ba7520ff5a556439fab869a4f805cbd5 100644 (file)
@@ -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
 
index 58400f033bfacfcf2855ff43a46be5c7262e6ee5..73bc70263b99e03f6e75d638638a418eebd18e9e 100644 (file)
@@ -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;