From: Kern Sibbald Date: Tue, 15 May 2007 21:34:42 +0000 (+0000) Subject: Try to make bsmtp date routines more generic. X-Git-Tag: Release-7.0.0~6337 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=485207627cc318ec9ee9dc7818173601d6ceb0e7;p=bacula%2Fbacula Try to make bsmtp date routines more generic. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4795 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/tools/bsmtp.c b/bacula/src/tools/bsmtp.c index 597cb34979..1397ff4d7f 100644 --- a/bacula/src/tools/bsmtp.c +++ b/bacula/src/tools/bsmtp.c @@ -151,6 +151,8 @@ static void get_date_string(char *buf, int buf_len) struct tm tm; char tzbuf[MAXSTRING]; long my_timezone; + struct timeval tv; + struct timezone tz; /* Add RFC822 date */ (void)localtime_r(&now, &tm); @@ -165,11 +167,8 @@ __MINGW_IMPORT long _dstbias; my_timezone /= 60; #else - tzset(); - my_timezone = timezone / 60; /* timezone offset in mins */ - if (tm.tm_isdst == 1) { - my_timezone -= 60; /* adjust for daylight savings */ - } + gettimeofday(&tv, &tz); + my_timezone = tz.tz_minuteswest; /* timezone offset in mins */ #endif strftime(buf, buf_len, "%a, %d %b %Y %H:%M:%S", &tm); sprintf(tzbuf, " %+2.2ld%2.2u", -my_timezone / 60, abs(my_timezone) % 60); diff --git a/bacula/technotes-2.1 b/bacula/technotes-2.1 index ae382ef456..10604835b3 100644 --- a/bacula/technotes-2.1 +++ b/bacula/technotes-2.1 @@ -2,6 +2,7 @@ General: 15May07 +kes Try to make bsmtp date routines more generic. kes Fixed bug #856 autochanger documentation. kes Rework bsmtp date editing for Win32. This fixes bug #854. kes Add new cats entry point so Win32 builds.