提交 b6d891c0 编写于 作者: X xionglei6

init: fix bugs

Signed-off-by: Nxionglei6 <xionglei6@huawei.com>
上级 9a9730c2
......@@ -262,6 +262,16 @@ static int BindCpuCore(Service *service)
return SERVICE_SUCCESS;
}
static void ClearEnvironment(void)
{
sigset_t mask;
sigemptyset(&mask);
sigaddset(&mask, SIGCHLD);
sigaddset(&mask, SIGTERM);
sigprocmask(SIG_UNBLOCK, &mask, NULL);
return;
}
int ServiceStart(Service *service)
{
INIT_ERROR_CHECK(service != NULL, return SERVICE_FAILURE, "start service failed! null ptr.");
......@@ -289,6 +299,8 @@ int ServiceStart(Service *service)
DoJobNow(service->serviceJobs.jobsName[JOB_ON_START]);
}
(void)ClearEnvironment();
if (!IsOnDemandService(service)) {
int ret = CreateServiceSocket(service);
INIT_ERROR_CHECK(ret >= 0, return SERVICE_FAILURE,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册