diff --git a/build/protoc.sh b/build/protoc.sh index 94390842defde2af9cb97e453862ecc125a2194f..01861dc74195e718dbb658bb583c3d180770b791 100755 --- 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 6a4e8840d305285e1bbd27828799778e4aa4aa01..04e58339239de80b2f15a152c9ce74c7656d1086 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 bddd068e084b88c5210f4042968b49f1f1ec104b..55501f7caaf28f9a431fd9954b05042c726fc443 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();