$NetBSD: patch-ai,v 1.3 2006/02/02 15:03:19 joerg Exp $ --- lib/psitime.cc.orig 2002-08-05 11:27:54.000000000 +0000 +++ lib/psitime.cc @@ -63,7 +63,7 @@ PsiTime::PsiTime(const u_int32_t _ptvHi, psi2unix(); } -PsiTime::PsiTime(struct timeval *_utv, struct timezone *_utz = 0L) { +PsiTime::PsiTime(struct timeval *_utv, struct timezone *_utz) { if (_utv != 0L) utv = *_utv; if (_utz != 0L) @@ -219,7 +219,11 @@ evalOffset(psi_timezone ptz, time_t time * daylight saving. */ struct tm *tm = localtime(&time); +#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined( __NetBSD__ ) || defined(__APPLE__) || defined(__DragonFly__) + offset = -tm->tm_gmtoff; +#else offset = timezone; +#endif if (tm->tm_isdst) offset += 3600; } @@ -228,7 +232,11 @@ evalOffset(psi_timezone ptz, time_t time // later time_t now = ::time(0); struct tm *now_tm = localtime(&now); +#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined( __NetBSD__ ) || defined(__APPLE__) || defined(__DragonFly__) + offset -= -now_tm->tm_gmtoff; +#else offset -= timezone; +#endif offset *= 1000000; return offset;