X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=sbr%2Fdtime.c;h=5d5375d4c4814599b15a4891d3b9802535400e06;hb=811c11557492b9a6e6bd5ae45bb5597647ba5c99;hp=14359557723ac3328ec09b1179ebc572d10da182;hpb=faa066cb24d3308ab5d2c40ed145ecb3940461bf;p=mmh diff --git a/sbr/dtime.c b/sbr/dtime.c index 1435955..5d5375d 100644 --- a/sbr/dtime.c +++ b/sbr/dtime.c @@ -2,8 +2,6 @@ /* * dtime.c -- time/date routines * - * $Id$ - * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. @@ -12,23 +10,9 @@ #include /* for snprintf() */ #include #include +#include -#if !defined(HAVE_STRUCT_TM_TM_GMTOFF) && !defined(HAVE_TZSET) -# include -#endif - -#ifdef TIME_WITH_SYS_TIME -# include -# include -#else -# ifdef HAVE_SYS_TIME_H -# include -# else -# include -# endif -#endif - -#if !defined(HAVE_STRUCT_TM_TM_GMTOFF) && defined(HAVE_TZSET) +#if !defined(HAVE_STRUCT_TM_TM_GMTOFF) extern int daylight; extern long timezone; extern char *tzname[]; @@ -142,10 +126,6 @@ dlocaltime (time_t *clock) static struct tws tw; struct tm *tm; -#if !defined(HAVE_STRUCT_TM_TM_GMTOFF) && !defined(HAVE_TZSET) - struct timeb tb; -#endif - if (!clock) return NULL; @@ -174,13 +154,8 @@ dlocaltime (time_t *clock) if (tm->tm_isdst) /* if DST is in effect */ tw.tw_zone -= 60; /* reset to normal offset */ #else -# ifdef HAVE_TZSET tzset(); tw.tw_zone = -(timezone / 60); -# else - ftime (&tb); - tw.tw_zone = -tb.timezone; -# endif #endif tw.tw_flags &= ~TW_SDAY; @@ -370,14 +345,8 @@ dtimezone (int offset, int flags) } if (!(flags & TW_ZONE) && mins == 0) { -#if defined(HAVE_TZSET) && defined(HAVE_TZNAME) tzset(); return ((flags & TW_DST) ? tzname[1] : tzname[0]); -#else - for (z = zones; z->std; z++) - if (z->shift == hours) - return (z->dst && (flags & TW_DST) ? z->dst : z->std); -#endif } #ifdef ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST