提交 cd200898 编写于 作者: O openharmony_ci 提交者: Gitee

!63 静态检查修改

Merge pull request !63 from 熊磊/072122
......@@ -17,6 +17,7 @@
#include <errno.h>
#include <fcntl.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <sys/ioctl.h>
......@@ -31,12 +32,12 @@ static int SendCmd(int cmd, unsigned long arg)
if (fd != -1) {
int ret = ioctl(fd, cmd, arg);
if (ret == -1) {
INIT_LOGE("[Init] [ERR] %s!", strerror(errno));
INIT_LOGE("[Init] [ERR] %d!", errno);
}
close(fd);
return ret;
}
INIT_LOGE("[Init] [ERR] %s!", strerror(errno));
INIT_LOGE("[Init] [ERR] %d!", errno);
return fd;
}
......@@ -45,7 +46,7 @@ int InitListen(unsigned long eventMask, unsigned int wait)
QuickstartListenArgs args;
args.wait = wait;
args.events = eventMask;
return SendCmd(QUICKSTART_LISTEN, (unsigned long)&args);
return SendCmd(QUICKSTART_LISTEN, (uintptr_t)&args);
}
int NotifyInit(unsigned long event)
......
......@@ -71,9 +71,8 @@ void InitLog(const char *tag, InitLogLevel logLevel, const char *fileName, int l
return;
}
time_t logTime;
time(&logTime);
struct tm *t = gmtime(&logTime);
time_t second = time(0);
struct tm *t = localtime(&second);
if (t == NULL) {
printf("time is NULL.\n");
return;
......
......@@ -329,10 +329,14 @@ static void DoCopy(const char* cmdContent)
out:
FreeCmd(&ctx);
ctx = NULL;
close(srcFd);
srcFd = -1;
close(dstFd);
dstFd = -1;
if (srcFd >= 0) {
close(srcFd);
srcFd = -1;
}
if (dstFd >= 0) {
close(dstFd);
dstFd = -1;
}
return;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册