--------------------- PatchSet 1035 Date: 2004/06/27 17:28:26 Author: serassio Branch: nt Tag: (none) Log: Better win32 gettimeofday() emulation Members: lib/win32lib.c:1.2.18.5->1.2.18.6 port/win32/include/squid-mswin.h:1.3.18.11->1.3.18.12 Index: squid3/lib/win32lib.c =================================================================== RCS file: /cvsroot/squid-sf//squid3/lib/win32lib.c,v retrieving revision 1.2.18.5 retrieving revision 1.2.18.6 diff -u -r1.2.18.5 -r1.2.18.6 --- squid3/lib/win32lib.c 21 Jun 2004 22:18:07 -0000 1.2.18.5 +++ squid3/lib/win32lib.c 27 Jun 2004 17:28:26 -0000 1.2.18.6 @@ -1,5 +1,5 @@ /* - * $Id: win32lib.c,v 1.2.18.5 2004/06/21 22:18:07 serassio Exp $ + * $Id: win32lib.c,v 1.2.18.6 2004/06/27 17:28:26 serassio Exp $ * * * * * * * * * Legal stuff * * * * * * * * @@ -106,7 +106,7 @@ return 0; } -int chroot (const char *dirname) +int chroot(const char *dirname) { if (SetCurrentDirectory(dirname)) return 0; @@ -164,12 +164,22 @@ else return 0; } -int gettimeofday( struct timeval * pcur_time,void * tz){ - struct _timeb current; - _ftime(¤t); - pcur_time->tv_sec=current.time; - pcur_time->tv_usec=current.millitm * 1000; - return 0; +int gettimeofday( struct timeval * pcur_time, struct timezone * tz) +{ + + struct _timeb current; + + _ftime(¤t); + + pcur_time->tv_sec=current.time; + pcur_time->tv_usec=current.millitm * 1000L; + if (tz) + { + tz->tz_minuteswest = current.timezone; /* minutes west of Greenwich */ + tz->tz_dsttime = current.dstflag; /* type of dst correction */ + } + + return 0; } int statfs(const char *path, struct statfs *sfs) Index: squid3/port/win32/include/squid-mswin.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/port/win32/include/Attic/squid-mswin.h,v retrieving revision 1.3.18.11 retrieving revision 1.3.18.12 diff -u -r1.3.18.11 -r1.3.18.12 --- squid3/port/win32/include/squid-mswin.h 11 Apr 2004 17:52:26 -0000 1.3.18.11 +++ squid3/port/win32/include/squid-mswin.h 27 Jun 2004 17:29:35 -0000 1.3.18.12 @@ -1,5 +1,5 @@ /* - * $Id: squid-mswin.h,v 1.3.18.11 2004/04/11 17:52:26 serassio Exp $ + * $Id: squid-mswin.h,v 1.3.18.12 2004/06/27 17:29:35 serassio Exp $ * * AUTHOR: Guido Serassio & Andrey Shorin * @@ -171,6 +171,12 @@ long f_spare[6]; /* spare for later */ }; +struct timezone + { + int tz_minuteswest; /* minutes west of Greenwich */ + int tz_dsttime; /* type of dst correction */ + }; + #define CHANGE_FD_SETSIZE 1 #if CHANGE_FD_SETSIZE && SQUID_MAXFD > DEFAULT_FD_SETSIZE #define FD_SETSIZE SQUID_MAXFD