未验证 提交 864bd0dc 编写于 作者: O openharmony_ci 提交者: Gitee

!810 修改序列号变量为静态类型

Merge pull request !810 from Mupceet/master_cc
......@@ -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.
先完成此消息的编辑!
想要评论请 注册