From: hno <> Date: Fri, 15 Nov 2002 20:29:20 +0000 (+0000) Subject: Don't abuse time_t for millisecond delta measurements. time_t X-Git-Tag: SQUID_3_0_PRE1~521 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7dd1ff77b5386f221e68d6cf323ff4528a29411d;p=thirdparty%2Fsquid.git Don't abuse time_t for millisecond delta measurements. time_t is seconds since 1970, not any other measurement. --- diff --git a/src/comm_select.cc b/src/comm_select.cc index 7b2dd16234..906c8b74ec 100644 --- a/src/comm_select.cc +++ b/src/comm_select.cc @@ -1,6 +1,6 @@ /* - * $Id: comm_select.cc,v 1.63 2002/10/28 01:12:28 adrian Exp $ + * $Id: comm_select.cc,v 1.64 2002/11/15 13:29:20 hno Exp $ * * DEBUG: section 5 Socket Functions * @@ -414,10 +414,6 @@ comm_select(int msec) } if (msec > MAX_POLL_TIME) msec = MAX_POLL_TIME; -#ifdef _SQUID_OS2_ - if (msec < 0) - msec = MAX_POLL_TIME; -#endif if (pending) msec = 0; for (;;) { diff --git a/src/event.cc b/src/event.cc index 9a969b5777..3a35ac40ef 100644 --- a/src/event.cc +++ b/src/event.cc @@ -1,6 +1,6 @@ /* - * $Id: event.cc,v 1.33 2002/10/13 20:35:01 robertc Exp $ + * $Id: event.cc,v 1.34 2002/11/15 13:29:20 hno Exp $ * * DEBUG: section 41 Event Processing * AUTHOR: Henrik Nordstrom @@ -141,12 +141,12 @@ eventRun(void) } } -time_t +int eventNextTime(void) { if (!tasks) - return (time_t) 10; - return (time_t) ((tasks->when - current_dtime) * 1000); + return (int) 10; + return (int) ((tasks->when - current_dtime) * 1000); } void diff --git a/src/main.cc b/src/main.cc index c3af68c384..2419655ddc 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1,6 +1,6 @@ /* - * $Id: main.cc,v 1.358 2002/10/28 01:12:27 adrian Exp $ + * $Id: main.cc,v 1.359 2002/11/15 13:29:20 hno Exp $ * * DEBUG: section 1 Startup and Main Loop * AUTHOR: Harvest Derived @@ -563,7 +563,7 @@ main(int argc, char **argv) { int errcount = 0; int n; /* # of GC'd objects */ - time_t loop_delay; + int loop_delay; mode_t oldmask; #if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) int WIN32_init_err; diff --git a/src/protos.h b/src/protos.h index 9d980d5d49..280c3b5033 100644 --- a/src/protos.h +++ b/src/protos.h @@ -1,6 +1,6 @@ /* - * $Id: protos.h,v 1.456 2002/10/21 14:00:02 adrian Exp $ + * $Id: protos.h,v 1.457 2002/11/15 13:29:20 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -266,7 +266,7 @@ SQUIDCEXTERN void idnsPTRLookup(const struct in_addr, IDNSCB *, void *); SQUIDCEXTERN void eventAdd(const char *name, EVH * func, void *arg, double when, int); SQUIDCEXTERN void eventAddIsh(const char *name, EVH * func, void *arg, double delta_ish, int); SQUIDCEXTERN void eventRun(void); -SQUIDCEXTERN time_t eventNextTime(void); +SQUIDCEXTERN int eventNextTime(void); SQUIDCEXTERN void eventDelete(EVH * func, void *arg); SQUIDCEXTERN void eventInit(void); SQUIDCEXTERN void eventFreeMemory(void);