]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Stop using own localtime as DST could be messy in many cases
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 4 Apr 2018 14:47:28 +0000 (15:47 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 4 Apr 2018 14:47:28 +0000 (15:47 +0100)
src/libutil/util.c

index b6057f08d9e38541d46125aed92d5f79b9a5f2ba..6957c25bf6ddf5093a1e310295bd4ecb0e2899d8 100644 (file)
@@ -2770,36 +2770,12 @@ rspamd_gmtime (gint64 ts, struct tm *dest)
        dest->tm_zone = "GMT";
 }
 
-#ifdef HAVE_SANE_TZSET
-extern char *tzname[2];
-extern long timezone;
-extern int daylight;
-
-void rspamd_localtime (gint64 ts, struct tm *dest)
-{
-       static gint64 last_tzcheck = 0;
-       static const guint tz_check_interval = 120;
-
-       if (ts - last_tzcheck > tz_check_interval) {
-               tzset ();
-               last_tzcheck = ts;
-       }
-
-       ts -= timezone;
-       rspamd_gmtime (ts, dest);
-       dest->tm_zone = daylight ? (tzname[1] ? tzname[1] : tzname[0]) : tzname[0];
-#if !defined(__sun)
-       dest->tm_gmtoff = -timezone;
-#endif
-}
-
-#else
-void rspamd_localtime (gint64 ts, struct tm *dest)
+void
+rspamd_localtime (gint64 ts, struct tm *dest)
 {
        time_t t = ts;
        localtime_r (&t, dest);
 }
-#endif
 
 gboolean
 rspamd_fstring_gzip (rspamd_fstring_t **in)