musl: read the timezone from /etc/TZ
authorFelix Fietkau <nbd@openwrt.org>
Fri, 19 Jun 2015 17:48:11 +0000 (17:48 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Fri, 19 Jun 2015 17:48:11 +0000 (17:48 +0000)
commit7b4d039e00b0e29f416c21a022ce2a6db23a4c30
treeb94bb63c1054ccf2b9f21999b23c52fa00bdaff3
parent23633249c80c8ae886569058349e345d3a905bbc
musl: read the timezone from /etc/TZ

Currently the OpenWRT boot scripts write the timezone configuration to
/tmp/TZ, relying on the behaviour of uClibc that the timezone is read
from /etc/TZ if no TZ env variable is found.

This works because /etc/TZ is a symlink to /tmp/TZ.

Musl libc however only reads the timezone from the TZ env variable and
if it doesn't find it or it's empty, it will look for a zoneinfo
file, that doesn't exist.

So in musl builds no timezone is ever set.

This patch fixes the issue by having musl libc behave like uClibc: if no
TZ env variable is found it will try to load it from /etc/TZ.

Signed-off-by: Gianluca Anzolin <gianluca at sottospazio.it>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
SVN-Revision: 46069
toolchain/musl/patches/110-read_timezone_from_fs.patch [new file with mode: 0644]