diff options
author | Eric Andersen <andersen@codepoet.org> | 2007-01-29 21:35:05 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2007-01-29 21:35:05 +0000 |
commit | 19d7c347f8405875e9dcd9ff532eb4942d3702a1 (patch) | |
tree | 9a566f03563e1876cc1f727440279038f87ab43e | |
parent | bdbe29d1dca1bff0e9b414dc8f60727ab96336ae (diff) | |
download | uClibc-alpine-0_9_28.tar.bz2 uClibc-alpine-0_9_28.tar.xz |
doh! wrong branch0_9_28
-rw-r--r-- | libc/misc/time/time.c | 44 |
1 files changed, 4 insertions, 40 deletions
diff --git a/libc/misc/time/time.c b/libc/misc/time/time.c index e36eab578..f43bb8a3c 100644 --- a/libc/misc/time/time.c +++ b/libc/misc/time/time.c @@ -155,23 +155,6 @@ #define TZNAME_MAX _POSIX_TZNAME_MAX #endif - -#if defined (L_tzset) || defined (L_localtime_r) || defined(L_strftime) || \ - defined(L__time_mktime) || defined(L__time_mktime_tzi) || \ - ((defined(L_strftime) || defined(L_strftime_l)) && \ - defined(__UCLIBC_HAS_XLOCALE__)) - -void _time_tzset (int); - -#ifndef L__time_mktime - - /* Jan 1, 2007 Z - tm = 0,0,0,1,0,107,1,0,0 */ - -const static time_t new_rule_starts = 1167609600; - -#endif -#endif - /**********************************************************************/ /* The era code is currently unfinished. */ /* #define ENABLE_ERA_CODE */ @@ -561,7 +544,7 @@ struct tm *localtime_r(register const time_t *__restrict timer, { TZLOCK; - _time_tzset(*timer < new_rule_starts); + tzset(); __time_localtime_tzi(timer, result, _time_tzinfo); @@ -985,8 +968,7 @@ size_t __XL(strftime)(char *__restrict s, size_t maxsize, unsigned char mod; unsigned char code; - /* We'll, let's get this out of the way. */ - _time_tzset(_time_mktime((struct tm *) timeptr, 0) < new_rule_starts); + tzset(); /* We'll, let's get this out of the way. */ lvl = 0; p = format; @@ -1668,9 +1650,7 @@ static const char vals[] = { 6, 0, 0, /* Note: overloaded for non-M non-J case... */ 0, 1, 0, /* J */ ',', 'M', '4', '.', '1', '.', '0', - ',', 'M', '1', '0', '.', '5', '.', '0', 0, - ',', 'M', '3', '.', '2', '.', '0', - ',', 'M', '1', '1', '.', '1', '.', '0', 0 + ',', 'M', '1', '0', '.', '5', '.', '0', 0 }; #define TZ vals @@ -1678,7 +1658,6 @@ static const char vals[] = { #define RANGE (vals + 7) #define RULE (vals + 11 - 1) #define DEFAULT_RULES (vals + 22) -#define DEFAULT_2007_RULES (vals + 38) /* Initialize to UTC. */ int daylight = 0; @@ -1803,11 +1782,6 @@ static char *read_TZ_file(char *buf) void tzset(void) { - _time_tzset((time(NULL)) < new_rule_starts); -} - -void _time_tzset(int use_old_rules) -{ register const char *e; register char *s; long off; @@ -1930,15 +1904,7 @@ void _time_tzset(int use_old_rules) } else { /* OK, we have dst, so get some rules. */ count = 0; if (!*e) { /* No rules so default to US rules. */ - e = use_old_rules ? DEFAULT_RULES : DEFAULT_2007_RULES; -#ifdef DEBUG_TZSET - if (e == DEFAULT_RULES) - printf("tzset: Using old rules.\n"); - else if (e == DEFAULT_2007_RULES) - printf("tzset: Using new rules\n"); - else - printf("tzset: Using undefined rules\n"); -#endif /* DEBUG_TZSET */ + e = DEFAULT_RULES; } do { @@ -2272,8 +2238,6 @@ time_t _time_mktime_tzi(struct tm *timeptr, int store_on_success, --d; } - _time_tzset (x.tm_year < 2007); /* tm_year was expanded above */ - #ifdef __BCC__ d = p[5] - 1; days = -719163L + ((long)d)*365 + ((d/4) - (d/100) + (d/400) + p[3] + p[7]); |