aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/util.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-04-04 15:47:28 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-04-04 15:47:28 +0100
commit8f2c82211defdac42bf913af79e576af73ea7da6 (patch)
tree5fa7ab5b3ddf9cdcb9471eda4c3f1942bdc7b0c9 /src/libutil/util.c
parent846c63f269f2bd333a24730b3cb92dbb37960328 (diff)
downloadrspamd-8f2c82211defdac42bf913af79e576af73ea7da6.tar.gz
rspamd-8f2c82211defdac42bf913af79e576af73ea7da6.zip
[Fix] Stop using own localtime as DST could be messy in many cases
Diffstat (limited to 'src/libutil/util.c')
-rw-r--r--src/libutil/util.c28
1 files changed, 2 insertions, 26 deletions
diff --git a/src/libutil/util.c b/src/libutil/util.c
index b6057f08d..6957c25bf 100644
--- a/src/libutil/util.c
+++ b/src/libutil/util.c
@@ -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)