Merge "Force set timezone to UTC in logd."

am: 0de940c26d

Change-Id: I2c68d784b134461bd82bc1d8fe05f95b1ad98225
This commit is contained in:
Hidehiko Abe 2017-04-13 07:21:24 +00:00 committed by android-build-merger
commit 5cadd1399b

View file

@ -407,6 +407,11 @@ static int issueReinit() {
// logging plugins like auditd and restart control. Additional
// transitory per-client threads are created for each reader.
int main(int argc, char* argv[]) {
// logd is written under the assumption that the timezone is UTC.
// If TZ is not set, persist.sys.timezone is looked up in some time utility
// libc functions, including mktime. It confuses the logd time handling,
// so here explicitly set TZ to UTC, which overrides the property.
setenv("TZ", "UTC", 1);
// issue reinit command. KISS argument parsing.
if ((argc > 1) && argv[1] && !strcmp(argv[1], "--reinit")) {
return issueReinit();