diff options
author | gilles <gilles@poolp.org> | 2016-05-22 13:19:25 +0200 |
---|---|---|
committer | gilles <gilles@poolp.org> | 2016-05-22 13:19:25 +0200 |
commit | 792cf029e57e978af6d9ab359d5b4af5788f397e (patch) | |
tree | 266a67374e7f021a75526c52273f1c9bceeaa584 /smtpd/to.c | |
parent | Merge branch 'master' into portable (diff) | |
parent | Some Os (as Solaris) don't have member tm_gmtoff in struct tm (diff) | |
download | OpenSMTPD-792cf029e57e978af6d9ab359d5b4af5788f397e.tar.xz OpenSMTPD-792cf029e57e978af6d9ab359d5b4af5788f397e.zip |
Merge branch 'solaris_struct_tm' of https://github.com/bsdsx/OpenSMTPD into bsdsx-solaris_struct_tm
Diffstat (limited to 'smtpd/to.c')
-rw-r--r-- | smtpd/to.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -207,8 +207,13 @@ time_to_text(time_t when) if (lt == NULL || when == 0) fatalx("time_to_text: localtime"); +#if HAVE_STRUCT_TM_TM_GMTOFF offset = lt->tm_gmtoff; tz = lt->tm_zone; +#elif defined HAVE_DECL_ALTZONE && defined HAVE_DECL_TIMEZONE + offset = lt->tm_isdst > 0 ? altzone : timezone; + tz = lt->tm_isdst > 0 ? tzname[1] : tzname[0]; +#endif /* We do not use strftime because it is subject to locale substitution*/ if (!bsnprintf(buf, sizeof(buf), |