提交 22ee1b14 编写于 作者: S sun_fan

init: fix code style

Signed-off-by: Nsun_fan <sun_fan@hoperun.com>
上级 593fe6e6
......@@ -71,7 +71,7 @@ typedef struct {
time_t firstCriticalCrashTime; // record for critical
char *writepidFiles[MAX_WRITEPID_FILES];
unsigned int attribute;
int important;
int importance;
Perms servPerm;
struct OnRestartCmd *onRestart;
struct ServiceSocket *socketCfg;
......
......@@ -226,9 +226,9 @@ int ServiceStart(Service *service)
INIT_LOGI("service->name is %s ", service->name);
#ifndef OHOS_LITE
if (service->important != 0) {
if (setpriority(PRIO_PROCESS, 0, service->important) != 0) {
INIT_LOGE("setpriority failed for %s, important = %d", service->name, service->important);
if (service->importance != 0) {
if (setpriority(PRIO_PROCESS, 0, service->importance) != 0) {
INIT_LOGE("setpriority failed for %s, importance = %d", service->name, service->importance);
_exit(0x7f); // 0x7f: user specified
}
}
......
......@@ -373,9 +373,9 @@ static int GetImportantValue(int value, Service *curServ)
}
#else
if (value >= MIN_IMPORTANT_LEVEL && value <= MAX_IMPORTANT_LEVEL) { // -20~19
curServ->important = value;
curServ->importance = value;
} else {
INIT_LOGE("important level = %d, is not between -20 and 19, error", value);
INIT_LOGE("importance level = %d, is not between -20 and 19, error", value);
return SERVICE_FAILURE;
}
#endif
......@@ -399,7 +399,7 @@ static int GetServiceNumber(const cJSON* curArrItem, Service* curServ, const cha
}
int value = (int)cJSON_GetNumberValue(filedJ);
// important value allow < 0
// importance value allow < 0
if (strncmp(targetField, IMPORTANT_STR_IN_CFG, strlen(IMPORTANT_STR_IN_CFG)) != 0) {
if (value < 0) {
INIT_LOGE("value = %d, error.service name is %s", value, curServ->name);
......
......@@ -363,11 +363,10 @@ struct DevPermissionMapper {
struct DevPermissionMapper DEV_MAPPER[] = {
{"/dev/binder", 0666, 0, 0},
{"/dev/input/event0", 0660, 0, 1004},
{"/dev/input/event0", 0660, 0, 0},
{"/dev/input/event1", 0660, 0, 1004},
{"/dev/input/mice", 0660, 0, 1004},
{"/dev/input/mouse0", 0660, 0, 0},
{"/dev/input/event0", 0660, 0, 0},
{"/dev/snd/timer", 0660, 1000, 1005},
{"/dev/zero", 0666, 0, 0},
{"/dev/full", 0666, 0, 0},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册