!63 静态检查修改

Merge pull request !63 from 熊磊/072122
This commit is contained in:
openharmony_ci
2021-07-21 12:35:59 +00:00
committed by Gitee
3 changed files with 14 additions and 10 deletions
+4 -3
View File
@@ -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)
+2 -3
View File
@@ -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;
+8 -4
View File
@@ -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;
}