3 @@ -31,6 +31,9 @@ static int r0[5], r1[5];
4 static const unsigned char *zi, *trans, *index, *types, *abbrevs, *abbrevs_end;
5 static size_t map_size;
7 +static const char *tzfile;
8 +static size_t tzfile_size;
10 static char old_tz_buf[32];
11 static char *old_tz = old_tz_buf;
12 static size_t old_tz_size = sizeof old_tz_buf;
13 @@ -132,6 +135,15 @@ static void do_tzset()
14 "/usr/share/zoneinfo/\0/share/zoneinfo/\0/etc/zoneinfo/\0";
18 + /* if TZ is empty try to read it from /etc/TZ */
21 + __munmap((void*)tzfile, tzfile_size);
23 + s = tzfile = (void *)__map_file("/etc/TZ", &tzfile_size);
26 if (!s) s = "/etc/localtime";