]> git.sur5r.net Git - bacula/bacula/commitdiff
Try to make bsmtp date routines more generic.
authorKern Sibbald <kern@sibbald.com>
Tue, 15 May 2007 21:34:42 +0000 (21:34 +0000)
committerKern Sibbald <kern@sibbald.com>
Tue, 15 May 2007 21:34:42 +0000 (21:34 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4795 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/tools/bsmtp.c
bacula/technotes-2.1

index 597cb34979d2363d2e5f808b8db943eb1a764408..1397ff4d7f0ad98f03f4aaa343aae8433600884b 100644 (file)
@@ -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);
index ae382ef456481ada17bf80f5d97662da892d108f..10604835b35fafe66670220eca7ef1e55d29531e 100644 (file)
@@ -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.