fix: 编码规范问题修复

1.拼写错误
2.指针判空
3.函数返回值处理

Signed-off-by: zhushengle <zhushengle@huawei.com>
Change-Id: I8fad28051cab6d99357ffbb29aa0720235ecf502
This commit is contained in:
zhushengle
2022-03-21 14:24:41 +08:00
parent 174db030a4
commit f60bc94cf2
25 changed files with 247 additions and 188 deletions

View File

@@ -62,6 +62,7 @@ static int TestCase(void)
rc = stat("/bin/shell", &st);
if (rc == -1) {
perror("stat");
close(shmFd);
return -1;
}
@@ -69,12 +70,14 @@ static int TestCase(void)
rc = ftruncate(shmFd, st.st_size);
if (rc == -1) {
perror("ftruncate");
close(shmFd);
return -1;
}
p = mmap(nullptr, st.st_size, PROT_READ | PROT_WRITE, MAP_SHARED, shmFd, 0);
if (p == MAP_FAILED) {
perror("mmap");
close(shmFd);
return -1;
}
@@ -83,6 +86,7 @@ static int TestCase(void)
if (fd == -1) {
perror("openls");
munmap(p, st.st_size);
close(shmFd);
return -1;
}