未验证 提交 8ab28013 编写于 作者: O openharmony_ci 提交者: Gitee

!379 fix: ondemand value parse

Merge pull request !379 from 熊磊/init0308xyt
......@@ -607,8 +607,7 @@ static int GetDynamicService(const cJSON *curArrItem, Service *curServ)
INIT_ERROR_CHECK(cJSON_IsBool(item), return SERVICE_FAILURE,
"Service : %s dynamic value only support bool.", curServ->name);
bool isDynamic = (bool)cJSON_GetNumberValue(item);
INIT_INFO_CHECK(isDynamic, return SERVICE_SUCCESS,
INIT_INFO_CHECK(cJSON_IsTrue(item), return SERVICE_SUCCESS,
"Service : %s dynamic value is false, it will be started with init.", curServ->name);
INIT_CHECK_RETURN_VALUE(!IsServiceInMainStrap(curServ), SERVICE_SUCCESS);
INIT_LOGI("%s is dynamic service", curServ->name);
......@@ -627,8 +626,7 @@ static int GetServiceOnDemand(const cJSON *curArrItem, Service *curServ)
INIT_ERROR_CHECK(cJSON_IsBool(item), return SERVICE_FAILURE,
"Service : %s ondemand value only support bool.", curServ->name);
bool isOnDemand = (bool)cJSON_GetNumberValue(item);
INIT_INFO_CHECK(isOnDemand, return SERVICE_SUCCESS,
INIT_INFO_CHECK(cJSON_IsTrue(item), return SERVICE_SUCCESS,
"Service : %s ondemand value is false, it will be manage socket by itself", curServ->name);
if (curServ->attribute & SERVICE_ATTR_CRITICAL) {
INIT_LOGE("Service : %s is invalid which has both critical and ondemand attribute", curServ->name);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册