From 31af742dd1cee131c16c1ef7c7205e4ae5e2e9e4 Mon Sep 17 00:00:00 2001 From: ganchuantao Date: Fri, 12 Sep 2025 10:48:52 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=20=20=20=20=E4=BF=AE=E5=A4=8D=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E5=91=8A=E8=AD=A6=20=20=20=20=20Signed-off-by:ganchua?= =?UTF-8?q?ntao1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ganchuantao --- build/protoc.sh | 2 +- device/cmds/src/main.cpp | 5 ++++- device/plugins/native_daemon/src/hook_manager.cpp | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) mode change 100755 => 100644 build/protoc.sh diff --git a/build/protoc.sh b/build/protoc.sh old mode 100755 new mode 100644 index 94390842d..01861dc74 --- a/build/protoc.sh +++ b/build/protoc.sh @@ -28,7 +28,7 @@ LAST_ARG_INDEX=$(($NUM_ARGS)) INDEP_COMPLIER=${!LAST_ARG_INDEX} PROTOC=$PROJECT_TOP/$2/thirdparty/protobuf/protoc -if [ ! -e $PROTOC ] ; then +if [ ! -e "$PROTOC" ] ; then if [[ "$INDEP_COMPLIER" == true ]]; then PROTOC=$PROJECT_TOP/binarys/third_party/protobuf/innerapis/protoc/clang_x64/libs/protoc fi diff --git a/device/cmds/src/main.cpp b/device/cmds/src/main.cpp index 6a4e8840d..04e583392 100644 --- a/device/cmds/src/main.cpp +++ b/device/cmds/src/main.cpp @@ -67,7 +67,10 @@ std::string GetLoopbackAddress() struct ifaddrs* ifAddrStruct = nullptr; void* tmpAddrPtr = nullptr; - getifaddrs(&ifAddrStruct); + if (getifaddrs(&ifAddrStruct) == -1) { // -1 : fail + printf("error: %s\n", COMMON::GetErrorMsg().c_str()); + return ""; + } while (ifAddrStruct != nullptr) { if (ifAddrStruct->ifa_addr == nullptr) { ifAddrStruct = ifAddrStruct->ifa_next; diff --git a/device/plugins/native_daemon/src/hook_manager.cpp b/device/plugins/native_daemon/src/hook_manager.cpp index bddd068e0..55501f7ca 100644 --- a/device/plugins/native_daemon/src/hook_manager.cpp +++ b/device/plugins/native_daemon/src/hook_manager.cpp @@ -596,9 +596,9 @@ bool HookManager::DestroyPluginSession(const std::vector& pluginIds) } } for (const auto& item : hookCtx_) { - for (int i = 0; i < item->eventPollerList.size(); ++i) { + for (size_t i = 0; i < item->eventPollerList.size(); ++i) { if (item->eventPollerList[i] && item->eventNotifierList[i]) { - PROFILER_LOG_ERROR(LOG_CORE, "eventPoller unset! num: %d", i); + PROFILER_LOG_ERROR(LOG_CORE, "eventPoller unset! num: %zu", i); item->eventPollerList[i]->RemoveFileDescriptor(item->eventNotifierList[i]->GetFd()); item->eventPollerList[i]->Stop(); item->eventPollerList[i]->Finalize(); -- Gitee From b2efdaf8b4e90ebe379492ddf8a28822bc06fb7d Mon Sep 17 00:00:00 2001 From: ganchuantao Date: Fri, 12 Sep 2025 13:40:58 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=20=20=20=20=E4=BF=AE=E5=A4=8D=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E5=91=8A=E8=AD=A6=20=20=20=20=20Signed-off-by:ganchua?= =?UTF-8?q?ntao1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ganchuantao --- build/protoc.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 build/protoc.sh diff --git a/build/protoc.sh b/build/protoc.sh old mode 100644 new mode 100755 -- Gitee