mirror of
https://gitee.com/openharmony/startup_init
synced 2024-11-30 22:01:06 +00:00
commit
0345a384be
@ -321,6 +321,8 @@ static int GetUid(cJSON *json, uid_t *uid)
|
||||
*uid = DecodeUid(str);
|
||||
} else if (cJSON_IsNumber(json)) {
|
||||
*uid = (uid_t)cJSON_GetNumberValue(json);
|
||||
} else {
|
||||
*uid = (uid_t)(-1);
|
||||
}
|
||||
INIT_CHECK_RETURN_VALUE(*uid != (uid_t)(-1), SERVICE_FAILURE);
|
||||
return SERVICE_SUCCESS;
|
||||
@ -967,12 +969,12 @@ void ParseAllServices(const cJSON *fileRoot)
|
||||
cJSON *curItem = cJSON_GetArrayItem(serviceArr, i);
|
||||
int ret = GetStringItem(curItem, "name", serviceName, MAX_SERVICE_NAME);
|
||||
if (ret != 0) {
|
||||
INIT_LOGE("Failed to get service name %s", serviceName);
|
||||
INIT_LOGE("Failed to get service name");
|
||||
continue;
|
||||
}
|
||||
Service *service = GetServiceByName(serviceName);
|
||||
if (service != NULL) {
|
||||
INIT_LOGE("Service name %s has been exist", serviceName);
|
||||
INIT_LOGE("Service \' %s \' already exist", serviceName);
|
||||
continue;
|
||||
}
|
||||
service = AddService(serviceName);
|
||||
|
@ -222,8 +222,8 @@ static void HandlerFdHolder(int sock)
|
||||
} else {
|
||||
INIT_LOGE("Unexpected action: %s", action);
|
||||
}
|
||||
FreeFds(fds);
|
||||
CloseFds(fds, fdCount);
|
||||
FreeFds(fds);
|
||||
FreeStringVector(msg, msgCount);
|
||||
}
|
||||
|
||||
|
@ -278,7 +278,7 @@ int ConvertInfixToPrefix(const char *condition, char *prefix, uint32_t prefixLen
|
||||
uint32_t prefixIndex = 0;
|
||||
size_t conditionLen = strlen(condition);
|
||||
LogicCalculator calculator;
|
||||
CalculatorInit(&calculator, MAX_CALC_PARAM, 1, 0);
|
||||
PARAM_CHECK(CalculatorInit(&calculator, MAX_CALC_PARAM, 1, 0) == 0, return -1, "Failed to init calculator");
|
||||
|
||||
while (curr < conditionLen) {
|
||||
if (condition[curr] == ')') {
|
||||
|
Loading…
Reference in New Issue
Block a user