From 6ecb7d259df0c2fe07e3ea99442c1d9228033ee8 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sun, 18 Feb 2018 17:08:48 +0000 Subject: [Fix] Add workaround for system with non-XSI compatible tzset --- src/libutil/util.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/libutil/util.c') diff --git a/src/libutil/util.c b/src/libutil/util.c index 5e271ed80..d1500b54a 100644 --- a/src/libutil/util.c +++ b/src/libutil/util.c @@ -2762,6 +2762,7 @@ 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; @@ -2784,6 +2785,14 @@ void rspamd_localtime (gint64 ts, struct tm *dest) #endif } +#else +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) { -- cgit v1.2.3