提交 87d47e0a 编写于 作者: H haotuo

fixed 5f672587 from https://gitee.com/shawshank506/third_party_musl/pulls/646

read tzzone from system param if defined
Signed-off-by: Nhaotuo <haotuo@huawei.com>
Change-Id: I06ca9d0ff471953fffc4bc5db0d00de366197ddb
Signed-off-by: Nhaotuo <haotuo@huawei.com>
上级 06588fcb
......@@ -21,6 +21,10 @@
#include "libc.h"
#include "lock.h"
#include "time_impl.h"
#ifdef OHOS_ENABLE_PARAMETER
#include "sys_param.h"
#define SYSPARAM_LENGTH 40
#endif
#define __TZ_VERSION__ '2'
......@@ -152,7 +156,18 @@ static void do_tzset()
s = getenv("TZ");
if (!s) {
#ifdef OHOS_ENABLE_PARAMETER
uint32_t tz_param_value_len = SYSPARAM_LENGTH;
char tz_param_value[SYSPARAM_LENGTH + 1] = {0};
if (SystemReadParam("persist.time.timezone", tz_param_value, &tz_param_value_len) == 0) {
tz_param_value[tz_param_value_len] = 0;
s = tz_param_value;
} else {
s = "/etc/localtime";
}
#else
s = "/etc/localtime";
#endif
}
if (!*s) {
s = __utc;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册