From e0a8873587b1225242756b06fb1b7fb0bd0e3132 Mon Sep 17 00:00:00 2001 From: fan-jingle Date: Sat, 16 Aug 2025 16:33:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=A5=E5=BF=97=E7=BA=A7?= =?UTF-8?q?=E5=88=AB?= 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/sandbox_dec.c | 6 +++--- modules/sysevent/event_reporter.cpp | 2 +- standard/appspawn_kickdog.c | 2 +- standard/appspawn_main.c | 2 +- standard/appspawn_manager.h | 2 +- standard/appspawn_service.c | 2 +- util/src/appspawn_utils.c | 2 +- 8 files changed, 10 insertions(+), 10 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/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/modules/sysevent/event_reporter.cpp b/modules/sysevent/event_reporter.cpp index 5a22925a..9d210753 100644 --- a/modules/sysevent/event_reporter.cpp +++ b/modules/sysevent/event_reporter.cpp @@ -48,7 +48,7 @@ void ProcessMgrRemoveApp(const char* processName, int pid, int uid, int status) int ret = HiSysEventWrite(HiSysEvent::Domain::STARTUP, KEY_PROCESS_EXIT, HiSysEvent::EventType::BEHAVIOR, KEY_NAME, pname, KEY_PID, pid, KEY_UID, uid, KEY_STATUS, status); if (ret != 0) { - APPSPAWN_LOGE("ProcessMgrRemoveApp error, ret: %{public}d", ret); + APPSPAWN_LOGW("ProcessMgrRemoveApp error, ret: %{public}d", ret); } } } 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/standard/appspawn_main.c b/standard/appspawn_main.c index ac4f7da8..2fd9d2d7 100644 --- a/standard/appspawn_main.c +++ b/standard/appspawn_main.c @@ -74,7 +74,7 @@ static void CheckPreload(char *const argv[]) APPSPAWN_CHECK(nread != -1, return, "readlink fail: /proc/self/exe: %{public}d", errno); buf[nread] = 0; ret = execv(buf, argv); - APPSPAWN_LOGE("execv fail: %{public}s: %{public}d: %{public}d", buf, errno, ret); + APPSPAWN_LOGI("execv fail: %{public}s: %{public}d: %{public}d", buf, errno, ret); } #ifndef NATIVE_SPAWN diff --git a/standard/appspawn_manager.h b/standard/appspawn_manager.h index 0ff87686..3925e59d 100644 --- a/standard/appspawn_manager.h +++ b/standard/appspawn_manager.h @@ -285,7 +285,7 @@ APPSPAWN_INLINE void *GetAppProperty(const AppSpawningCtx *property, uint32_t ty APPSPAWN_INLINE void *GetAppPropertyExt(const AppSpawningCtx *property, const char *name, uint32_t *len) { APPSPAWN_CHECK(name != NULL, return NULL, "Invalid name "); - APPSPAWN_CHECK(property != NULL && property->message != NULL, + APPSPAWN_CHECK_LOGW(property != NULL && property->message != NULL, return NULL, "Invalid property for name %{public}s", name); return GetAppSpawnMsgExtInfo(property->message, name, len); } diff --git a/standard/appspawn_service.c b/standard/appspawn_service.c index d80261f1..894fe12e 100644 --- a/standard/appspawn_service.c +++ b/standard/appspawn_service.c @@ -124,7 +124,7 @@ static inline void DumpStatus(const char *appName, pid_t pid, int status, int *s APPSPAWN_STATIC void WriteSignalInfoToFd(AppSpawnedProcess *appInfo, AppSpawnContent *content, int signal) { - APPSPAWN_CHECK(content->signalFd > 0, return, "Invalid signal fd[%{public}d]", content->signalFd); + APPSPAWN_CHECK_LOGW(content->signalFd > 0, return, "Invalid signal fd[%{public}d]", content->signalFd); APPSPAWN_CHECK(appInfo->pid > 0, return, "Invalid pid[%{public}d]", appInfo->pid); APPSPAWN_CHECK(appInfo->uid > 0, return, "Invalid uid[%{public}d]", appInfo->uid); APPSPAWN_CHECK(appInfo->name != NULL, return, "Invalid name"); 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