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

!1275 修复 cfg文件解析 有重复service 配置情况下优先级的问题

Merge pull request !1275 from cheng_jinsong/initsf0921
...@@ -990,14 +990,14 @@ void ParseAllServices(const cJSON *fileRoot) ...@@ -990,14 +990,14 @@ void ParseAllServices(const cJSON *fileRoot)
continue; continue;
} }
Service *service = GetServiceByName(fieldStr); Service *service = GetServiceByName(fieldStr);
if (service != NULL) {
INIT_LOGE("Service \' %s \' already exist", fieldStr);
continue;
}
service = AddService(fieldStr);
if (service == NULL) { if (service == NULL) {
INIT_LOGE("Failed to create service name %s", fieldStr); service = AddService(fieldStr);
continue; if (service == NULL) {
INIT_LOGE("Failed to add service name %s", fieldStr);
continue;
}
} else {
INIT_LOGI("Service %s already exists, updating.", fieldStr);
} }
service->pid = -1; service->pid = -1;
int ret = ParseOneService(curItem, service); int ret = ParseOneService(curItem, service);
......
...@@ -218,15 +218,15 @@ static void StartInitSecondStage(void) ...@@ -218,15 +218,15 @@ static void StartInitSecondStage(void)
void SystemPrepare(void) void SystemPrepare(void)
{ {
INIT_LOGI("Start init first stage.");
MountBasicFs(); MountBasicFs();
CreateDeviceNode(); CreateDeviceNode();
LogInit(); LogInit();
// Make sure init log always output to /dev/kmsg. // Make sure init log always output to /dev/kmsg.
EnableDevKmsg(); EnableDevKmsg();
INIT_LOGI("Start init first stage.");
// Only ohos normal system support // Only ohos normal system support
// two stages of init. // two stages of init.
// If we are in updater mode, only one stage of init, // If we are in updater mode, only one stage of init.
if (InUpdaterMode() == 0) { if (InUpdaterMode() == 0) {
StartInitSecondStage(); StartInitSecondStage();
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册