X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Ftime%2F__tz.c;h=c34b3eb755a54b38efa8f8e4b39e0bfb1e23b406;hb=b1dfb734a45d4f74c7a24c5f07d37f7e74451802;hp=814edcdf68f8ef91e372e1fe0e8d78af3e533e83;hpb=92c52644e04ac754b1b282a9d33d033e04e1399e;p=musl diff --git a/src/time/__tz.c b/src/time/__tz.c index 814edcdf..c34b3eb7 100644 --- a/src/time/__tz.c +++ b/src/time/__tz.c @@ -3,7 +3,16 @@ #include #include #include +#include +#include #include "libc.h" +#include "lock.h" +#include "fork_impl.h" + +#define malloc __libc_malloc +#define calloc undef +#define realloc undef +#define free undef long __timezone = 0; int __daylight = 0; @@ -28,6 +37,7 @@ static char *old_tz = old_tz_buf; static size_t old_tz_size = sizeof old_tz_buf; static volatile int lock[1]; +volatile int *const __timezone_lockptr = lock; static int getint(const char **p) { @@ -84,15 +94,15 @@ static void getname(char *d, const char **p) int i; if (**p == '<') { ++*p; - for (i=0; (*p)[i]!='>' && i 4 && map[4]=='2') { + if (map[4]!='1') { size_t skip = zi_dotprod(zi+20, VEC(1,1,8,5,6,1), 6); trans = zi+skip+44+44; scale++; @@ -194,7 +215,6 @@ static void do_tzset() const unsigned char *p; __tzname[0] = __tzname[1] = 0; __daylight = __timezone = dst_off = 0; - for (i=0; i<5; i++) r0[i] = r1[i] = 0; for (p=types; p>scale; if (a == n-1) return -1; if (a == 0) { - x = zi_read32(trans + (a<