From a0769972879cdb099515197c438399d30c860db5 Mon Sep 17 00:00:00 2001 From: xujintong Date: Wed, 21 Feb 2024 17:04:01 +0800 Subject: [PATCH 1/2] =?UTF-8?q?4.1=E5=91=8A=E8=AD=A6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xujintong --- .../backup_api/backup_impl/service_proxy_test.cpp | 2 -- utils/src/b_filesystem/b_dir.cpp | 3 ++- utils/src/b_process/b_process.cpp | 8 ++++---- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/tests/unittests/backup_api/backup_impl/service_proxy_test.cpp b/tests/unittests/backup_api/backup_impl/service_proxy_test.cpp index ecc24d04a..4d1fca6ef 100644 --- a/tests/unittests/backup_api/backup_impl/service_proxy_test.cpp +++ b/tests/unittests/backup_api/backup_impl/service_proxy_test.cpp @@ -380,8 +380,6 @@ HWTEST_F(ServiceProxyTest, SUB_Service_proxy_OnLoadSystemAbilitySuccess_0101, te sptr loadCallback = new ServiceProxy::ServiceProxyLoadCallback(); EXPECT_NE(loadCallback, nullptr); int32_t systemAbilityId = 0; - // const OHOS::sptr &remoteObject = make_shared(); - // shared_ptr remoteObject = make_shared(); sptr remoteObject = new MockIRemoteObject(); loadCallback->OnLoadSystemAbilitySuccess(systemAbilityId, remoteObject); loadCallback = nullptr; diff --git a/utils/src/b_filesystem/b_dir.cpp b/utils/src/b_filesystem/b_dir.cpp index 3f02020cd..3a85735d7 100644 --- a/utils/src/b_filesystem/b_dir.cpp +++ b/utils/src/b_filesystem/b_dir.cpp @@ -165,7 +165,8 @@ static set ExpandPathWildcard(const vector &vec, bool onlyPath) } } - set expandPath, filteredPath; + set expandPath; + set filteredPath; for (size_t i = 0; i < gl->gl_pathc; ++i) { expandPath.emplace(gl->gl_pathv[i]); } diff --git a/utils/src/b_process/b_process.cpp b/utils/src/b_process/b_process.cpp index 78b9226a2..71c88874d 100644 --- a/utils/src/b_process/b_process.cpp +++ b/utils/src/b_process/b_process.cpp @@ -40,14 +40,14 @@ static tuple WaitForChild(pid_t pid, unique_ptr> pipeStream, function DetectFatalLog) { - const int BUF_LEN = 1024; - auto buf = make_unique(BUF_LEN); + const int buflen = 1024; + auto buf = make_unique(buflen); int status = 0; do { regex reg("^\\W*$"); - while ((void)memset_s(buf.get(), BUF_LEN, 0, BUF_LEN), - fgets(buf.get(), BUF_LEN - 1, pipeStream.get()) != nullptr) { + while ((void)memset_s(buf.get(), buflen, 0, buflen), + fgets(buf.get(), buflen - 1, pipeStream.get()) != nullptr) { if (regex_match(buf.get(), reg)) { continue; } -- Gitee From 7f89fd1625da56c2c6fee6aff36f22ae6160ab03 Mon Sep 17 00:00:00 2001 From: xujintong Date: Fri, 23 Feb 2024 01:25:09 +0000 Subject: [PATCH 2/2] update utils/src/b_process/b_process.cpp. Signed-off-by: xujintong --- utils/src/b_process/b_process.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utils/src/b_process/b_process.cpp b/utils/src/b_process/b_process.cpp index 71c88874d..0a2a4989a 100644 --- a/utils/src/b_process/b_process.cpp +++ b/utils/src/b_process/b_process.cpp @@ -40,14 +40,14 @@ static tuple WaitForChild(pid_t pid, unique_ptr> pipeStream, function DetectFatalLog) { - const int buflen = 1024; - auto buf = make_unique(buflen); + const int bufLen = 1024; + auto buf = make_unique(bufLen); int status = 0; do { regex reg("^\\W*$"); - while ((void)memset_s(buf.get(), buflen, 0, buflen), - fgets(buf.get(), buflen - 1, pipeStream.get()) != nullptr) { + while ((void)memset_s(buf.get(), bufLen, 0, bufLen), + fgets(buf.get(), bufLen - 1, pipeStream.get()) != nullptr) { if (regex_match(buf.get(), reg)) { continue; } -- Gitee