提交 9220282a 编写于 作者: H H. Peter Anvin

Move signal setting into service_loop()

上级 7626e49e
......@@ -480,6 +480,8 @@ static int service_loop(int socknum, int *socklist)
pfd[i].fd = socklist[i];
pfd[i].events = POLLIN;
}
signal(SIGCHLD, child_handler);
for (;;) {
int i;
......@@ -518,8 +520,6 @@ static int serve(int port)
{
int socknum, *socklist;
signal(SIGCHLD, child_handler);
socknum = socksetup(port, &socklist);
if (socknum == 0)
die("unable to allocate any listen sockets on port %u", port);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册