From 716ca530e1c4515d8683c9d5be3d56b301758b66 Mon Sep 17 00:00:00 2001 From: James <> Date: Wed, 4 Nov 2015 11:49:21 +0000 Subject: trunk-47381 --- .../musl/patches/110-read_timezone_from_fs.patch | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 toolchain/musl/patches/110-read_timezone_from_fs.patch (limited to 'toolchain/musl/patches/110-read_timezone_from_fs.patch') diff --git a/toolchain/musl/patches/110-read_timezone_from_fs.patch b/toolchain/musl/patches/110-read_timezone_from_fs.patch new file mode 100644 index 0000000..b4349e7 --- /dev/null +++ b/toolchain/musl/patches/110-read_timezone_from_fs.patch @@ -0,0 +1,28 @@ +--- a/src/time/__tz.c ++++ b/src/time/__tz.c +@@ -23,6 +23,9 @@ static int r0[5], r1[5]; + static const unsigned char *zi, *trans, *index, *types, *abbrevs, *abbrevs_end; + static size_t map_size; + ++static const char *tzfile; ++static size_t tzfile_size; ++ + static char old_tz_buf[32]; + static char *old_tz = old_tz_buf; + static size_t old_tz_size = sizeof old_tz_buf; +@@ -125,6 +128,15 @@ static void do_tzset() + "/usr/share/zoneinfo/\0/share/zoneinfo/\0/etc/zoneinfo/\0"; + + s = getenv("TZ"); ++ ++ /* if TZ is empty try to read it from /etc/TZ */ ++ if (!s || !*s) { ++ if (tzfile) ++ __munmap((void*)tzfile, tzfile_size); ++ ++ s = tzfile = (void *)__map_file("/etc/TZ", &tzfile_size); ++ } ++ + if (!s) s = "/etc/localtime"; + if (!*s) s = __gmt; + -- cgit v1.2.3