Merge pull request !315 from 黄志敏/master
This commit is contained in:
openharmony_ci 2022-07-07 10:25:00 +00:00 committed by Gitee
commit 6982c7de53
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
4 changed files with 12 additions and 3 deletions

View File

@ -19,6 +19,14 @@ namespace OHOS {
namespace UserIam {
namespace UserAuth {
const int32_t INVALID_AUTH_TYPE = -1;
#define IAM_TRY(action0, action1) \
do { \
try { \
action0; \
} catch (...) { \
action1; \
} \
} while (0)
enum OperationType : uint32_t {
TRACE_ADD_CREDENTIAL = 0,

View File

@ -20,6 +20,7 @@
#include <string>
#include "iam_logger.h"
#include "iam_defines.h"
#include "nocopyable.h"
namespace OHOS {
@ -34,7 +35,7 @@ public:
~IamScopeGuard() override
{
if (action_ != nullptr) {
action_();
IAM_TRY(action_(), return);
}
}

View File

@ -32,7 +32,7 @@ const std::string GetNowTimeString()
struct tm curr;
char timeStr[buffSize + 1] = {0};
localtime_r(&tt, &curr);
int32_t len = snprintf_s(timeStr, sizeof(timeStr), dataLen, "%04d-%02d-%02d %02d:%02d:%02d",
int32_t len = snprintf_s(timeStr, sizeof(timeStr), dataLen, "%04u-%02d-%02d %02d:%02d:%02d",
curr.tm_year + startYear, curr.tm_mon + 1, curr.tm_mday, curr.tm_hour, curr.tm_min, curr.tm_sec);
if (len < 0) {
return std::string();

View File

@ -113,7 +113,7 @@ bool AuthenticationImpl::Update(const std::vector<uint8_t> &scheduleResult, Auth
ResourceNodeUtils::SendMsgToExecutor(executorIndex, msg);
}
resultInfo.result = info.result;
resultInfo.result = static_cast<decltype(resultInfo.result)>(info.result);
resultInfo.freezingTime = info.freezingTime;
resultInfo.remainTimes = info.remainTimes;
resultInfo.token = info.token;