From eb5390a6deb1694fa4d41d7b1caf100113a65dc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A8=8A=E6=99=AF=E4=B9=90?= Date: Mon, 9 Jun 2025 15:58:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 樊景乐 --- modules/common/appspawn_silk.c | 12 ++++++++---- modules/sandbox/sandbox_shared_mount.cpp | 2 +- standard/appspawn_kickdog.c | 6 +++--- standard/appspawn_msgmgr.c | 2 +- standard/appspawn_service.c | 4 ++-- util/include/appspawn_utils.h | 5 ++++- 6 files changed, 19 insertions(+), 12 deletions(-) diff --git a/modules/common/appspawn_silk.c b/modules/common/appspawn_silk.c index 6e05a5bb..ae867c23 100644 --- a/modules/common/appspawn_silk.c +++ b/modules/common/appspawn_silk.c @@ -128,10 +128,14 @@ static void FreeAllSilkConfig(void) void LoadSilkLibrary(const char *packageName) { - APPSPAWN_CHECK(g_silkConfig.configItems != NULL, return, - "ConfigItems is NULL"); - APPSPAWN_CHECK(packageName != NULL, FreeAllSilkConfig(); return, - "PackageName is NULL"); + if (g_silkConfig.configItems == NULL) { + APPSPAWN_LOGV("ConfigItems is NULL"); + return; + } + if (packageName == NULL) { + APPSPAWN_LOGV("PackageName is NULL"); + return; + } char **appName = NULL; void *handle = NULL; for (int i = 0; i < g_silkConfig.configCursor; i++) { diff --git a/modules/sandbox/sandbox_shared_mount.cpp b/modules/sandbox/sandbox_shared_mount.cpp index c752a28b..528dca99 100644 --- a/modules/sandbox/sandbox_shared_mount.cpp +++ b/modules/sandbox/sandbox_shared_mount.cpp @@ -114,7 +114,7 @@ static bool IsUnlockStatus(uint32_t uid) std::string lockStatusParam = "startup.appspawn.lockstatus_" + std::to_string(uid); char userLockStatus[LOCK_STATUS_SIZE] = {0}; int ret = GetParameter(lockStatusParam.c_str(), "1", userLockStatus, sizeof(userLockStatus)); - APPSPAWN_LOGI("get param %{public}s %{public}s", lockStatusParam.c_str(), userLockStatus); + APPSPAWN_LOGI("lockStatus %{public}u %{public}s", uid, userLockStatus); if (ret > 0 && (strcmp(userLockStatus, "0") == 0)) { // 0:unlock status 1:lock status return true; } diff --git a/standard/appspawn_kickdog.c b/standard/appspawn_kickdog.c index 04a7db13..a471c7d1 100644 --- a/standard/appspawn_kickdog.c +++ b/standard/appspawn_kickdog.c @@ -73,9 +73,9 @@ static void DealSpawnWatchdog(AppSpawnContent *content, bool isOpen) if (isOpen) { content->wdgOpened = (result != -1); } - APPSPAWN_LOGI("%{public}s %{public}s %{public}s watchdog end,result:%{public}d", - content->isLinux ? "Linux" : "Hm", (content->mode == MODE_FOR_NWEB_SPAWN) ? - "Nwebspawn" : "Appspawn", isOpen ? "enable" : "kick", result); + APPSPAWN_DUMP_LOGI("%{public}s %{public}s %{public}d", + (content->mode == MODE_FOR_NWEB_SPAWN) ? + "Nweb" : "Apps", isOpen ? "enable" : "kick", result); } static void ProcessTimerHandle(const TimerHandle taskHandle, void *context) diff --git a/standard/appspawn_msgmgr.c b/standard/appspawn_msgmgr.c index 2e844d93..51d9f8df 100644 --- a/standard/appspawn_msgmgr.c +++ b/standard/appspawn_msgmgr.c @@ -386,7 +386,7 @@ void DumpAppSpawnMsg(const AppSpawnMsgNode *message) APPSPAWN_DUMP("App dac info uid: %{public}d gid: %{public}d count: %{public}d", dacInfo->uid, dacInfo->gid, dacInfo->gidCount); for (uint32_t i = 0; i < dacInfo->gidCount; i++) { - APPSPAWN_DUMP("gid group[%{public}d]: %{public}d", i, dacInfo->gidTable[i]); + APPSPAWN_LOGV("gid group[%{public}d]: %{public}d", i, dacInfo->gidTable[i]); } } AppSpawnMsgBundleInfo *bundleInfo = (AppSpawnMsgBundleInfo *)GetAppSpawnMsgInfo(message, TLV_BUNDLE_INFO); diff --git a/standard/appspawn_service.c b/standard/appspawn_service.c index 9a5c5795..fa68507d 100644 --- a/standard/appspawn_service.c +++ b/standard/appspawn_service.c @@ -460,8 +460,8 @@ static void OnReceiveRequest(const TaskHandle taskHandle, const uint8_t *buffer, connection->receiverCtx.incompleteMsg = NULL; int ret = 0; do { - APPSPAWN_LOGI("OnReceiveRequest connectionId: %{public}u start: 0x%{public}x buffLen %{public}d", - connection->connectionId, *(uint32_t *)(buffer + currLen), buffLen - currLen); + APPSPAWN_LOGI("connectionId:%{public}u buffLen:%{public}d", + connection->connectionId, buffLen - currLen); ret = GetAppSpawnMsgFromBuffer(buffer + currLen, buffLen - currLen, &message, &connection->receiverCtx.msgRecvLen, &reminder); diff --git a/util/include/appspawn_utils.h b/util/include/appspawn_utils.h index 2ab428c7..1fe1c99c 100644 --- a/util/include/appspawn_utils.h +++ b/util/include/appspawn_utils.h @@ -181,7 +181,8 @@ int EnableNewNetNamespace(void); HILOG_WARN(LOG_CORE, "[%{public}s:%{public}d]" fmt, (APP_FILE_NAME), (__LINE__), ##__VA_ARGS__) #define APPSPAWN_LOGF(fmt, ...) \ HILOG_FATAL(LOG_CORE, "[%{public}s:%{public}d]" fmt, (APP_FILE_NAME), (__LINE__), ##__VA_ARGS__) - +#define APPSPAWN_DUMP_LOGI(fmt, ...) \ + HILOG_INFO(LOG_CORE, fmt, ##__VA_ARGS__) #define APPSPAWN_DUMP(fmt, ...) \ do { \ HILOG_INFO(LOG_CORE, fmt, ##__VA_ARGS__); \ @@ -198,6 +199,8 @@ int EnableNewNetNamespace(void); HILOG_DEBUG(HILOG_MODULE_HIVIEW, "[%{public}s:%{public}d]" fmt, (APP_FILE_NAME), (__LINE__), ##__VA_ARGS__) #define APPSPAWN_LOGW(fmt, ...) \ HILOG_FATAL(HILOG_MODULE_HIVIEW, "[%{public}s:%{public}d]" fmt, (APP_FILE_NAME), (__LINE__), ##__VA_ARGS__) +#define APPSPAWN_DUMP_LOGI(fmt, ...) \ + HILOG_INFO(HILOG_MODULE_HIVIEW, fmt, ##__VA_ARGS__) #endif #define APPSPAWN_CHECK(retCode, exper, fmt, ...) \ -- Gitee