提交 455dd81b 编写于 作者: O openharmony_ci 提交者: Gitee

!20 静态检查修改

Merge pull request !20 from 熊磊/init0722
......@@ -80,7 +80,7 @@ static enum OHOSLiteErrorCode ReadStringItem(cJSON* strItem, char** buf, size_t
return EC_NOMEMORY;
}
if (strLength > 0 && memcpy_s(bufTmp, strLength + 1, strPtr, strLength) != EOK) {
if (strLength > 0 && memcpy_s(bufTmp, strLength, strPtr, strLength) != EOK) {
free(bufTmp);
bufTmp = NULL;
return EC_FAILURE;
......
......@@ -150,9 +150,6 @@ pid_t CreateProcess(const MessageSt* msgSt)
#endif // OHOS_DEBUG
// set permissions
if (msgSt->caps == NULL) {
exit(0x7f); // 0x7f: user specified
}
if (SetPerms(msgSt->uID, msgSt->gID, msgSt->capsCnt, msgSt->caps) != 0) {
HILOG_ERROR(HILOG_MODULE_HIVIEW, "[appspawn] sub-process %{public}s exit!", msgSt->bundleName);
exit(0x7f); // 0x7f: user specified
......@@ -167,7 +164,7 @@ pid_t CreateProcess(const MessageSt* msgSt)
getpid(), errno);
}
// 1s = 1000000000ns
long timeUsed = (tmEnd.tv_sec - tmStart.tv_sec) * (long)1000000000 + (tmEnd.tv_nsec - tmStart.tv_nsec);
long timeUsed = (tmEnd.tv_sec - tmStart.tv_sec) * 1000000000L + (tmEnd.tv_nsec - tmStart.tv_nsec);
HILOG_INFO(HILOG_MODULE_HIVIEW, "[appspawn] sub-process, pid %{public}d, timeused %ld ns.",\
getpid(), timeUsed);
#endif // OHOS_DEBUG
......
......@@ -161,7 +161,7 @@ static int Invoke(IServerProxy* iProxy, int funcId, void* origin, IpcIo* req, Ip
GetCurTime(&tmEnd);
// 1s = 1000000000ns
long timeUsed = (tmEnd.tv_sec - tmStart.tv_sec) * (long)1000000000 + (tmEnd.tv_nsec - tmStart.tv_nsec);
long timeUsed = (tmEnd.tv_sec - tmStart.tv_sec) * 1000000000L + (tmEnd.tv_nsec - tmStart.tv_nsec);
HILOG_INFO(HILOG_MODULE_HIVIEW, "[appspawn] invoke, reply pid %{public}d, timeused %{public}ld ns.",\
newPid, timeUsed);
#else
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册