summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2005-05-28 19:53:18 +0000
committerStef Walter <stef@memberwebs.com>2005-05-28 19:53:18 +0000
commitf9d9ebea4ae7518f1570b21a3a7a562c72e736bb (patch)
treeac22a9b10a6631f1e0c2f2416159fcb953f3b7cf
parent8a09d9575e3fdb1c9df38047cbc20534bf1be63d (diff)
More fixes to the date code.
-rw-r--r--common/smtppass.c12
-rw-r--r--configure.in4
2 files changed, 13 insertions, 3 deletions
diff --git a/common/smtppass.c b/common/smtppass.c
index 8a09cc8..550484d 100644
--- a/common/smtppass.c
+++ b/common/smtppass.c
@@ -1336,8 +1336,16 @@ static void make_date(spctx_t* ctx, char* date)
trim_end(date);
date_len = strlen(date);
- snprintf(date + date_len, MAX_DATE_LENGTH - date_len, " %+03d%02d (%s)",
- (int)(timezone / 3600), (int)(timezone % 3600), tzname[t2.tm_isdst ? 1 : 0]);
+ {
+#ifdef HAVE_TM_GMTOFF
+ time_t timezone = t2.tm_gmtoff;
+ const char *tzname[2] = { t2.tm_zone, t2.tm_zone };
+#else
+ tzset();
+#endif
+ snprintf(date + date_len, MAX_DATE_LENGTH - date_len, " %+03d%02d (%s)",
+ (int)(timezone / 3600), (int)(timezone % 3600), tzname[t2.tm_isdst ? 1 : 0]);
+ }
/* Break it off just in case */
date[MAX_DATE_LENGTH - 1] = 0;
diff --git a/configure.in b/configure.in
index 5d8611b..24c02f1 100644
--- a/configure.in
+++ b/configure.in
@@ -98,7 +98,9 @@ AC_CHECK_DECL(PTHREAD_MUTEX_ERRORCHECK_NP, [AC_DEFINE(HAVE_ERR_MUTEX, 1, "Error
[ #include <pthread.h> ])], [ #include <pthread.h> ])
# Required Variables
-AC_CHECK_MEMBER(struct tm.tm_gmtoff,,,[ #include <time.h> ])
+AC_CHECK_MEMBER(struct tm.tm_gmtoff,
+ [AC_DEFINE(HAVE_TM_GMTOFF, 1, "Time Zone GMT Offset")],
+ ,[ #include <time.h> ])
AC_CHECK_GLOBAL(__argv)
# Required Functions