diff options
author | phk <phk@FreeBSD.org> | 1997-07-25 19:49:22 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1997-07-25 19:49:22 +0000 |
commit | 2dc6791f72a12d7fea3d6813130029169d87cc16 (patch) | |
tree | 38ce8839dc42d5895bce61d667beb65c7b6360e1 /contrib/tcl/unix/tclUnixTime.c | |
parent | 021417e0de807dffe85f2ebec2dd9b568d4e545d (diff) | |
download | FreeBSD-src-2dc6791f72a12d7fea3d6813130029169d87cc16.zip FreeBSD-src-2dc6791f72a12d7fea3d6813130029169d87cc16.tar.gz |
Resolve conflicts, seems like just one of our changes didn't make it back.
Diffstat (limited to 'contrib/tcl/unix/tclUnixTime.c')
-rw-r--r-- | contrib/tcl/unix/tclUnixTime.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/contrib/tcl/unix/tclUnixTime.c b/contrib/tcl/unix/tclUnixTime.c index 21f1885..03a7315 100644 --- a/contrib/tcl/unix/tclUnixTime.c +++ b/contrib/tcl/unix/tclUnixTime.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * SCCS: @(#) tclUnixTime.c 1.11 96/07/23 16:17:21 + * SCCS: @(#) tclUnixTime.c 1.12 97/01/08 17:38:15 */ #include "tclInt.h" @@ -88,7 +88,8 @@ TclpGetClicks() * this function. * * Results: - * Hours east of GMT. + * The return value is the local time zone, measured in + * minutes away from GMT (-ve for east, +ve for west). * * Side effects: * None. @@ -137,6 +138,24 @@ TclpGetTimeZone (currentTime) return timeZone; #endif +#if defined(USE_DELTA_FOR_TZ) +#define TCL_GOT_TIMEZONE 1 + /* + * This hack replaces using global var timezone or gettimeofday + * in situations where they are buggy such as on AIX when libbsd.a + * is linked in. + */ + + int timeZone; + time_t tt; + struct tm *stm; + tt = 849268800L; /* 1996-11-29 12:00:00 GMT */ + stm = localtime(&tt); /* eg 1996-11-29 6:00:00 CST6CDT */ + /* The calculation below assumes a max of +12 or -12 hours from GMT */ + timeZone = (12 - stm->tm_hour)*60 + (0 - stm->tm_min); + return timeZone; /* eg +360 for CST6CDT */ +#endif + /* * Must prefer timezone variable over gettimeofday, as gettimeofday does * not return timezone information on many systems that have moved this @@ -163,7 +182,7 @@ TclpGetTimeZone (currentTime) return timeZone; #endif -#if defined(HAVE_GETTIMEOFDAY) && !defined (TCL_GOT_TIMEZONE) +#if !defined(NO_GETTOD) && !defined (TCL_GOT_TIMEZONE) # define TCL_GOT_TIMEZONE struct timeval tv; struct timezone tz; |