From 33e408d6c187391f38338ecf093c15a36dc5d977 Mon Sep 17 00:00:00 2001 From: cheng_jinsong Date: Wed, 21 Sep 2022 17:09:16 +0800 Subject: [PATCH] fix parse cfg priority Signed-off-by: cheng_jinsong --- services/init/init_service_manager.c | 14 +++++++------- services/init/standard/init.c | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/services/init/init_service_manager.c b/services/init/init_service_manager.c index 55d1740d..e3505d32 100755 --- a/services/init/init_service_manager.c +++ b/services/init/init_service_manager.c @@ -990,14 +990,14 @@ void ParseAllServices(const cJSON *fileRoot) continue; } Service *service = GetServiceByName(fieldStr); - if (service != NULL) { - INIT_LOGE("Service \' %s \' already exist", fieldStr); - continue; - } - service = AddService(fieldStr); if (service == NULL) { - INIT_LOGE("Failed to create service name %s", fieldStr); - continue; + service = AddService(fieldStr); + 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; int ret = ParseOneService(curItem, service); diff --git a/services/init/standard/init.c b/services/init/standard/init.c index 9e3cc34f..b8b6229c 100755 --- a/services/init/standard/init.c +++ b/services/init/standard/init.c @@ -218,15 +218,15 @@ static void StartInitSecondStage(void) void SystemPrepare(void) { - INIT_LOGI("Start init first stage."); MountBasicFs(); CreateDeviceNode(); LogInit(); // Make sure init log always output to /dev/kmsg. EnableDevKmsg(); + INIT_LOGI("Start init first stage."); // Only ohos normal system support // 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) { StartInitSecondStage(); } -- GitLab