提交 c9fc516d 编写于 作者: C chengjinsong

codex

Signed-off-by: Nchengjinsong <chengjinsong2@huawei.com>
上级 d76daafc
......@@ -19,7 +19,7 @@
#include "partitionslot_manager.h"
using namespace OHOS::HDI::Partitionslot::V1_0;
const int32_t PARTITION_ARGC = 2;
static const int32_t PARTITION_ARGC = 2;
static int GetSlot(BShellHandle handle, int32_t argc, char *argv[])
{
......
......@@ -33,7 +33,7 @@ int ConnectServer(int fd, const char *servername)
addr.sun_family = AF_UNIX;
ret = sprintf_s(addr.sun_path, sizeof(addr.sun_path) - 1, "%s", servername);
PARAM_CHECK(ret > EOK, return -1, "Failed to sprintf_s server address");
size_t len = offsetof(struct sockaddr_un, sun_path) + strlen(addr.sun_path);
socklen_t len = offsetof(struct sockaddr_un, sun_path) + strlen(addr.sun_path);
ret = connect(fd, (struct sockaddr *)&addr, len);
PARAM_CHECK(ret != -1, return -1, "Failed to connect server %s %d", servername, errno);
PARAM_LOGV("ConnectServer %s success", servername);
......
......@@ -59,7 +59,7 @@ public:
{
pid_t pid = fork();
if (pid == 0) {
if (prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0)) {
if (prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0) != 0) {
std::cout << "PR_SET_NO_NEW_PRIVS set fail " << std::endl;
exit(EXIT_FAILURE);
}
......@@ -117,7 +117,7 @@ public:
return -1;
}
if (flag) {
if (flag != 0) {
std::cout << "Child process time out" << std::endl;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册