提交 d3fd50bb 编写于 作者: C chengjinsong

codex

Signed-off-by: Nchengjinsong <chengjinsong2@huawei.com>
Change-Id: I9ac10355b1d8110929781714bff5b2d600280cef
上级 4f40470f
......@@ -33,7 +33,7 @@
static bool IsSupportFilterFlag(unsigned int filterFlag)
{
errno = 0;
int ret = syscall(__NR_seccomp, SECCOMP_SET_MODE_FILTER, filterFlag, NULL);
long ret = syscall(__NR_seccomp, SECCOMP_SET_MODE_FILTER, filterFlag, NULL);
if (ret != -1 || errno != EFAULT) {
SECCOMP_LOGE("not support seccomp flag %u", filterFlag);
return false;
......
......@@ -92,7 +92,7 @@ static int InitLocalSecurityLabel(ParamSecurityLabel *security, int isInit)
security->flags[PARAM_SECURITY_SELINUX] = 0;
PARAM_LOGV("InitLocalSecurityLabel");
#if !(defined STARTUP_INIT_TEST || defined LOCAL_TEST)
if (isInit) {
if ((bool)isInit) {
int ret = InitSelinuxOpsForInit(&GetParamWorkSpace()->selinuxSpace);
PARAM_CHECK(ret == 0, return -1, "Failed to init selinux ops");
} else {
......
......@@ -105,7 +105,7 @@ static int CheckNeedInit(int onlyRead, const PARAM_WORKSPACE_OPS *ops)
g_paramWorkSpace.ops.setfilecon = ops->setfilecon;
#endif
}
PARAM_LOGI("InitParamWorkSpace %p %x", &g_paramWorkSpace, g_paramWorkSpace.flags);
PARAM_LOGI("InitParamWorkSpace %x", g_paramWorkSpace.flags);
if (PARAM_TEST_FLAG(g_paramWorkSpace.flags, WORKSPACE_FLAGS_INIT)) {
return 0;
}
......@@ -118,7 +118,7 @@ static int CheckNeedInit(int onlyRead, const PARAM_WORKSPACE_OPS *ops)
}
// for ut, do not init workspace
char path[PATH_MAX] = { 0 };
(void)readlink("/proc/self/exe", path, sizeof(path));
(void)readlink("/proc/self/exe", path, sizeof(path) - 1);
char *name = strrchr(path, '/');
if (name != NULL) {
name++;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册