OSDN Git Service

init: fix localtime_r not work in /init
authorMa Jian <majian@jidemail.com>
Sun, 12 Jun 2016 07:25:43 +0000 (15:25 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Mon, 27 Jun 2016 09:10:20 +0000 (17:10 +0800)
commit595899f754191927658a6ae37e4c281bba6e73e7
tree1c2c8459f1ad4ab99aaddef1edc51e6685c8c28d
parent1da9387422994b4737233d2f08f0768c185bb73e
init: fix localtime_r not work in /init

There is no ANDROID_ROOT environment variable set in /init so that
localtime_r doesn't work because it cannot find the correct tzdata
file under /system.

NO_REF_TASK
Tested:
1) make sure persist.rtc_local_time is 1
2) make sure sysclktz 1 in init.rc
3) set local time in android and reboot to bios, bios should have
   local time
4) reboot back to android, the system time should be correct in
   local time (even network time sync is not available)

Change-Id: I762b8d9a8923e4a4bf58fcafe347b2708a1c8736
initrd/init