提交 f4c79d98 编写于 作者: X xiacong

<fix>

覆盖率版本屏蔽dlclose操作,使其不发生段错误
Signed-off-by: Nxiacong <xiacong4@huawei.com>
Change-Id: I11e45a6151ce7ae84312ebb96b778f30d0d664a3
Signed-off-by: Nxiacong <xiacong4@huawei.com>
上级 6dfe4809
...@@ -216,11 +216,11 @@ bool SetSeccompPolicyWithName(const char *filterName) ...@@ -216,11 +216,11 @@ bool SetSeccompPolicyWithName(const char *filterName)
} else { } else {
PLUGIN_LOGE("GetSeccompPolicy failed return is %d", retCode); PLUGIN_LOGE("GetSeccompPolicy failed return is %d", retCode);
} }
#ifndef COVERAGE_TEST
if (handler != NULL) { if (handler != NULL) {
dlclose(handler); dlclose(handler);
} }
#endif
if (filterLibRealPath != NULL) { if (filterLibRealPath != NULL) {
free(filterLibRealPath); free(filterLibRealPath);
} }
......
...@@ -323,10 +323,20 @@ ohos_unittest("init_unittest") { ...@@ -323,10 +323,20 @@ ohos_unittest("init_unittest") {
} }
if (defined(build_seccomp) && build_seccomp) { if (defined(build_seccomp) && build_seccomp) {
sources += [ "seccomp/seccomp_unittest.cpp" ] sources += [
"../../services/modules/seccomp/seccomp_policy.c",
"seccomp/seccomp_unittest.cpp",
]
include_dirs += include_dirs +=
[ "//base/startup/init/interfaces/innerkits/seccomp/include" ] [ "//base/startup/init/interfaces/innerkits/seccomp/include" ]
external_deps += [ "init:seccomp" ]
if (build_variant == "root") {
defines += [ "WITH_SECCOMP_DEBUG" ]
}
if (use_clang_coverage) {
defines += [ "COVERAGE_TEST" ]
}
} }
if (defined(build_selinux) && build_selinux) { if (defined(build_selinux) && build_selinux) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册