mirror of
https://gitee.com/openharmony/startup_init
synced 2024-11-27 10:20:46 +00:00
commit
0952893b34
@ -180,7 +180,7 @@ static void ShowParam(BShellHandle shell, const char *name, const char *value)
|
||||
user->pw_name,
|
||||
GetPermissionString(auditData.dacData.mode, 0, permissionStr[0], MASK_LENGTH_MAX),
|
||||
group->gr_name,
|
||||
GetPermissionString(auditData.dacData.mode,DAC_GROUP_START, permissionStr[1], MASK_LENGTH_MAX),
|
||||
GetPermissionString(auditData.dacData.mode, DAC_GROUP_START, permissionStr[1], MASK_LENGTH_MAX),
|
||||
// 2 other
|
||||
GetPermissionString(auditData.dacData.mode, DAC_OTHER_START, permissionStr[2], MASK_LENGTH_MAX));
|
||||
}
|
||||
|
@ -908,7 +908,7 @@ static int GetServicePeriod(const cJSON *curArrItem, Service *curServ, const cha
|
||||
INIT_ERROR_CHECK(cJSON_IsNumber(arrItem), return SERVICE_FAILURE,
|
||||
"Service error %s is null or is not a number", curServ->name);
|
||||
curServ->attribute |= SERVICE_ATTR_PERIOD;
|
||||
int value = (int)cJSON_GetNumberValue(arrItem);
|
||||
uint64_t value = (uint64_t)cJSON_GetNumberValue(arrItem);
|
||||
curServ->period = value * BASE_MS_UNIT;
|
||||
return SERVICE_SUCCESS;
|
||||
}
|
||||
|
@ -111,7 +111,7 @@ static LE_STATUS RunLoop_(const EventLoop *loop)
|
||||
} else if (GetCurrentTimespec(0) >= minTimePeriod) {
|
||||
timeout = 0;
|
||||
} else {
|
||||
timeout = minTimePeriod - GetCurrentTimespec(0);
|
||||
timeout = (int)(minTimePeriod - GetCurrentTimespec(0));
|
||||
}
|
||||
|
||||
int number = epoll_wait(epoll->epollFd, epoll->waitEvents, loop->maxevents, timeout);
|
||||
|
@ -169,8 +169,8 @@ uint8_t *LE_GetBufferInfo(const BufferHandle handle, uint32_t *dataSize, uint32_
|
||||
LE_STATUS LE_Send(const LoopHandle loopHandle,
|
||||
const TaskHandle taskHandle, const BufferHandle buffHandle, uint32_t buffLen)
|
||||
{
|
||||
LE_CHECK(loopHandle != NULL, return LE_INVALID_PARAM, "Loop is NULL");
|
||||
LE_CHECK(taskHandle != NULL && buffHandle != NULL, return LE_INVALID_TASK, "Invalid parameters");
|
||||
LE_CHECK(loopHandle != NULL && buffHandle != NULL, return LE_INVALID_PARAM, "Invalid parameters");
|
||||
LE_CHECK(taskHandle != NULL, return LE_INVALID_TASK, "Invalid task");
|
||||
EventLoop *loop = (EventLoop *)loopHandle;
|
||||
if (((BaseTask *)taskHandle)->flags & TASK_FLAGS_INVALID) {
|
||||
LE_FreeBuffer(loopHandle, taskHandle, buffHandle);
|
||||
|
@ -32,7 +32,7 @@ uint64_t GetCurrentTimespec(uint64_t timeout)
|
||||
struct timespec start;
|
||||
clock_gettime(CLOCK_MONOTONIC, &start);
|
||||
uint64_t ms = timeout;
|
||||
ms += (uint64_t)start.tv_sec * LE_SEC_TO_MSEC + start.tv_nsec / LE_MSEC_TO_NSEC;
|
||||
ms += (uint64_t)start.tv_sec * LE_SEC_TO_MSEC + (uint64_t)start.tv_nsec / LE_MSEC_TO_NSEC;
|
||||
return ms;
|
||||
}
|
||||
|
||||
|
@ -127,7 +127,7 @@ static int FreeLocalSecurityLabel(ParamSecurityLabel *srcLabel)
|
||||
|
||||
static int DacGetGroupMember(gid_t gid, uid_t *member, uint32_t *memberSize)
|
||||
{
|
||||
uint32_t inputLen = *memberSize;
|
||||
int32_t inputLen = (int32_t)*memberSize;
|
||||
*memberSize = 0;
|
||||
struct group *data = getgrgid(gid);
|
||||
if (data == NULL || data->gr_mem == NULL) {
|
||||
|
Loading…
Reference in New Issue
Block a user