提交 c2248a6a 编写于 作者: W wonghiu45

fix bug for init sys adj

Signed-off-by: Nwonghiu45 <huangxiao35@huawei.com>
上级 4751c44a
......@@ -297,6 +297,22 @@ static void InitPostHook(const HOOK_INFO *hookInfo, void *executionContext, int
hookInfo->stage, hookInfo->prio, hookInfo->hook, diff, executionRetVal);
}
static void InitSysAdj(void)
{
const char* path = "/proc/1/oom_score_adj";
const char* content = "-1000";
int fd = open(path, O_RDWR);
if (fd == -1) {
return;
}
if (write(fd, content, strlen(content)) < 0) {
close(fd);
return;
}
close(fd);
return;
}
static void TriggerServices(int startMode)
{
int index = 0;
......@@ -340,6 +356,8 @@ static void TriggerServices(int startMode)
void SystemConfig(void)
{
INIT_TIMING_STAT timingStat;
InitSysAdj();
HOOK_EXEC_OPTIONS options;
options.flags = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册