From beef2f0ff83b13de2560a9c501eed47716db0174 Mon Sep 17 00:00:00 2001 From: fan-jingle Date: Mon, 18 Aug 2025 14:33:09 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BC=98=E5=8C=96=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: fan-jingle --- modules/common/appspawn_silk.c | 2 +- modules/sandbox/normal/sandbox_common.cpp | 4 ++-- modules/sandbox/sandbox_dec.c | 6 +++--- standard/appspawn_kickdog.c | 2 +- util/src/appspawn_utils.c | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/common/appspawn_silk.c b/modules/common/appspawn_silk.c index 2f8d9141..b709edea 100644 --- a/modules/common/appspawn_silk.c +++ b/modules/common/appspawn_silk.c @@ -110,7 +110,7 @@ APPSPAWN_STATIC bool ParseSilkConfig(const cJSON *root, struct SilkConfig *confi void LoadSilkConfig(void) { cJSON *root = GetJsonObjFromFile(SILK_JSON_CONFIG_PATH); - APPSPAWN_CHECK(root != NULL, return, "Failed to load silk config"); + APPSPAWN_CHECK_LOGW(root != NULL, return, "Failed to load silk config"); (void)ParseSilkConfig(root, &g_silkConfig); cJSON_Delete(root); } diff --git a/modules/sandbox/normal/sandbox_common.cpp b/modules/sandbox/normal/sandbox_common.cpp index 9eca40fc..ac7f323c 100644 --- a/modules/sandbox/normal/sandbox_common.cpp +++ b/modules/sandbox/normal/sandbox_common.cpp @@ -153,14 +153,14 @@ int SandboxCommon::LoadAppSandboxConfigCJson(AppSpawnMgr *content) std::string appPath = path + SandboxCommonDef::APP_JSON_CONFIG; APPSPAWN_LOGI("LoadAppSandboxConfig %{public}s", appPath.c_str()); sandboxCJsonRoot = GetJsonObjFromFile(appPath.c_str()); - APPSPAWN_CHECK((sandboxCJsonRoot != nullptr && cJSON_IsObject(sandboxCJsonRoot)), continue, + APPSPAWN_CHECK_LOGW((sandboxCJsonRoot != nullptr && cJSON_IsObject(sandboxCJsonRoot)), continue, "Failed to load app data sandbox config %{public}s", appPath.c_str()); StoreCJsonConfig(sandboxCJsonRoot, SandboxCommonDef::SANDBOX_APP_JSON_CONFIG); std::string isolatedPath = path + SandboxCommonDef::APP_ISOLATED_JSON_CONFIG; APPSPAWN_LOGI("LoadAppSandboxConfig %{public}s", isolatedPath.c_str()); sandboxCJsonRoot = GetJsonObjFromFile(isolatedPath.c_str()); - APPSPAWN_CHECK((sandboxCJsonRoot != nullptr && cJSON_IsObject(sandboxCJsonRoot)), continue, + APPSPAWN_CHECK_LOGW((sandboxCJsonRoot != nullptr && cJSON_IsObject(sandboxCJsonRoot)), continue, "Failed to load app data sandbox config %{public}s", isolatedPath.c_str()); StoreCJsonConfig(sandboxCJsonRoot, SandboxCommonDef::SANDBOX_ISOLATED_JSON_CONFIG); } diff --git a/modules/sandbox/sandbox_dec.c b/modules/sandbox/sandbox_dec.c index 8e36ea2e..58ffa3ca 100644 --- a/modules/sandbox/sandbox_dec.c +++ b/modules/sandbox/sandbox_dec.c @@ -106,7 +106,7 @@ static int SetDenyConstraintDirs(AppSpawnMgr *content) const char *decFilename = "/dev/dec"; int fd = open(decFilename, O_RDWR); if (fd < 0) { - APPSPAWN_LOGE("open dec file fail."); + APPSPAWN_LOGW("open dec file fail."); return 0; } @@ -140,7 +140,7 @@ static int SetForcedPrefixDirs(AppSpawnMgr *content) const char *decFilename = "/dev/dec"; int fd = open(decFilename, O_RDWR); if (fd < 0) { - APPSPAWN_LOGE("open dec file fail."); + APPSPAWN_LOGW("open dec file fail."); return 0; } @@ -175,7 +175,7 @@ void SetDecPolicy(void) const char *decFilename = "/dev/dec"; int fd = open(decFilename, O_RDWR); if (fd < 0) { - APPSPAWN_LOGE("open dec file fail."); + APPSPAWN_LOGW("open dec file fail."); DestroyDecPolicyInfos(g_decPolicyInfos); g_decPolicyInfos = NULL; return; diff --git a/standard/appspawn_kickdog.c b/standard/appspawn_kickdog.c index ef01677b..73acd4e4 100644 --- a/standard/appspawn_kickdog.c +++ b/standard/appspawn_kickdog.c @@ -127,7 +127,7 @@ static int CheckKernelType(bool *isLinux) APPSPAWN_STATIC int SpawnKickDogStart(AppSpawnMgr *mgrContent) { APPSPAWN_CHECK(mgrContent != NULL, return 0, "content is null"); - APPSPAWN_CHECK((mgrContent->content.mode == MODE_FOR_APP_SPAWN) || + APPSPAWN_CHECK_LOGW((mgrContent->content.mode == MODE_FOR_APP_SPAWN) || (mgrContent->content.mode == MODE_FOR_NWEB_SPAWN) || (mgrContent->content.mode == MODE_FOR_HYBRID_SPAWN), return 0, "Mode %{public}u no need enable watchdog", mgrContent->content.mode); diff --git a/util/src/appspawn_utils.c b/util/src/appspawn_utils.c index 20d8ca2e..3553cb7e 100644 --- a/util/src/appspawn_utils.c +++ b/util/src/appspawn_utils.c @@ -300,7 +300,7 @@ int ParseJsonConfig(const char *basePath, const char *fileName, ParseConfig pars APPSPAWN_CHECK(len > 0 && (size_t)len < sizeof(path), ret = APPSPAWN_SANDBOX_INVALID; continue, "Failed to format sandbox config file name %{public}s %{public}s", files->paths[i], fileName); cJSON *root = GetJsonObjFromFile(path); - APPSPAWN_CHECK(root != NULL, ret = APPSPAWN_SANDBOX_INVALID; + APPSPAWN_CHECK_LOGW(root != NULL, ret = APPSPAWN_SANDBOX_INVALID; continue, "Failed to load app data sandbox config %{public}s", path); int rc = parseConfig(root, context); if (rc != 0) { -- Gitee