提交 960a939f 编写于 作者: L laiguizhong

修改序列号变量存储方式

Signed-off-by: Nlaiguizhong <laiguizhong@huawei.com>
Change-Id: I78fcc478f08fdd40dde35fd4bf7f84fde2dcabf5
上级 5cde4ec3
......@@ -191,7 +191,10 @@ INIT_LOCAL_API const char *GetSerial_(void)
#ifdef LITEOS_SUPPORT
return HalGetSerial();
#else
static char ohos_serial[PARAM_VALUE_LEN_MAX] = {0};
static char *ohos_serial = NULL;
if (ohos_serial == NULL) {
BEGET_CHECK((ohos_serial = (char *)calloc(1, PARAM_VALUE_LEN_MAX)) != NULL, return NULL);
}
uint32_t len = PARAM_VALUE_LEN_MAX;
int ret = SystemGetParameter("ohos.boot.sn", ohos_serial, &len);
BEGET_CHECK(ret == 0, return NULL);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册