From 0e4bc6fa7fa8ad74a1c3e855411bdc0e63bc6a2e Mon Sep 17 00:00:00 2001 From: markus schnalke Date: Tue, 27 Mar 2012 10:20:25 +0200 Subject: [PATCH] Removed HAVE_STRUCT_TM_TM_GMTOFF support. timezone, tzname, and tzset() are all POSIX. Pulled in from nmh. Thanks to David Levine. --- configure.ac | 2 -- sbr/dtime.c | 16 ---------------- 2 files changed, 18 deletions(-) diff --git a/configure.ac b/configure.ac index b3b517b..0387a18 100644 --- a/configure.ac +++ b/configure.ac @@ -533,8 +533,6 @@ dnl ---------------- dnl CHECK STRUCTURES dnl ---------------- -AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[#include ]) - AC_CHECK_MEMBERS(struct utmp.ut_type,,,[#include ]) AC_STRUCT_DIRENT_D_TYPE diff --git a/sbr/dtime.c b/sbr/dtime.c index e0405e9..5a73934 100644 --- a/sbr/dtime.c +++ b/sbr/dtime.c @@ -11,12 +11,6 @@ #include #include -#if !defined(HAVE_STRUCT_TM_TM_GMTOFF) -extern int daylight; -extern long timezone; -extern char *tzname[]; -#endif - #ifndef abs # define abs(a) (a >= 0 ? a : -a) #endif @@ -85,10 +79,6 @@ dlocaltime(time_t *clock) static struct tws tw; struct tm *tm; -#if !defined(HAVE_STRUCT_TM_TM_GMTOFF) - struct timeb tb; -#endif - if (!clock) return NULL; @@ -112,14 +102,8 @@ dlocaltime(time_t *clock) if (tm->tm_isdst) tw.tw_flags |= TW_DST; -#ifdef HAVE_STRUCT_TM_TM_GMTOFF - tw.tw_zone = tm->tm_gmtoff / 60; - if (tm->tm_isdst) /* if DST is in effect */ - tw.tw_zone -= 60; /* reset to normal offset */ -#else tzset(); tw.tw_zone = -(timezone / 60); -#endif tw.tw_flags &= ~TW_SDAY; tw.tw_flags |= TW_SEXP; -- 1.7.10.4