From 8f4016232958f89c0a32d713a84ed4d2b82d092d Mon Sep 17 00:00:00 2001 From: zuojiangjiang Date: Wed, 23 Mar 2022 14:12:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=86=85=E6=BA=90=E6=A3=80=E8=A7=86=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E4=BF=AE=E6=94=B9=20Signed-off-by:=20zuojiangjiang=20?= =?UTF-8?q??= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- services/distributeddataservice/app/src/query_helper.cpp | 2 +- .../distributeddataservice/app/src/security/security.cpp | 2 +- .../distributeddataservice/app/src/single_kvstore_impl.cpp | 6 +++--- services/distributeddataservice/service/rdb/rdb_syncer.cpp | 4 +++- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/services/distributeddataservice/app/src/query_helper.cpp b/services/distributeddataservice/app/src/query_helper.cpp index cb56bf8a5..2c8ce69f6 100644 --- a/services/distributeddataservice/app/src/query_helper.cpp +++ b/services/distributeddataservice/app/src/query_helper.cpp @@ -15,6 +15,7 @@ #define LOG_TAG "QueryHelper" +#include "query_helper.h" #include #include #include @@ -22,7 +23,6 @@ #include "data_query.h" #include "log_print.h" #include "types.h" -#include "query_helper.h" namespace OHOS::DistributedKv { constexpr int QUERY_SKIP_SIZE = 1; diff --git a/services/distributeddataservice/app/src/security/security.cpp b/services/distributeddataservice/app/src/security/security.cpp index ff70dd7f3..632ae0f52 100644 --- a/services/distributeddataservice/app/src/security/security.cpp +++ b/services/distributeddataservice/app/src/security/security.cpp @@ -241,7 +241,7 @@ DBStatus Security::GetFileSecurityOption(const std::string &filePath, SecurityOp option = {NOT_SET, ECE}; return OK; } - ZLOGI("get security option %{public}s", value.c_str()); + ZLOGI("get security option %s", value.c_str()); if (value == "s3") { option = { Convert2Security(value), SECE }; } else { diff --git a/services/distributeddataservice/app/src/single_kvstore_impl.cpp b/services/distributeddataservice/app/src/single_kvstore_impl.cpp index 3fd750615..33c121c04 100644 --- a/services/distributeddataservice/app/src/single_kvstore_impl.cpp +++ b/services/distributeddataservice/app/src/single_kvstore_impl.cpp @@ -900,7 +900,7 @@ std::vector SingleKvStoreImpl::MapNodeIdToUuids(const std::vector &deviceIds, } DdsTrace trace(std::string(LOG_TAG "Delegate::") + std::string(__FUNCTION__)); status = kvStoreNbDelegate_->SubscribeRemoteQuery(deviceUuids, syncEnd, dbQuery, false); - ZLOGD("end: %d", static_cast(status)); + ZLOGD("end: %u", static_cast(status)); } Reporter::GetInstance()->VisitStatistic()->Report({bundleName_, __FUNCTION__}); return ConvertDbStatus(status); @@ -962,7 +962,7 @@ Status SingleKvStoreImpl::DoUnSubscribe(const std::vector &deviceId } DdsTrace trace(std::string(LOG_TAG "Delegate::") + std::string(__FUNCTION__)); status = kvStoreNbDelegate_->UnSubscribeRemoteQuery(deviceUuids, syncEnd, dbQuery, false); - ZLOGD("end: %d", static_cast(status)); + ZLOGD("end: %u", static_cast(status)); } return ConvertDbStatus(status); } diff --git a/services/distributeddataservice/service/rdb/rdb_syncer.cpp b/services/distributeddataservice/service/rdb/rdb_syncer.cpp index 3731e28a0..87ad4dea4 100644 --- a/services/distributeddataservice/service/rdb/rdb_syncer.cpp +++ b/services/distributeddataservice/service/rdb/rdb_syncer.cpp @@ -41,7 +41,9 @@ RdbSyncer::~RdbSyncer() noexcept if ((manager_ != nullptr) && (delegate_ != nullptr)) { manager_->CloseStore(delegate_); } - delete manager_; + if (manager_ != nullptr) { + delete manager_; + } if (observer_ != nullptr) { delete observer_; } -- Gitee