Move signal setting into service_loop()
This commit is contained in:
parent
7626e49e9f
commit
9220282a9c
4
daemon.c
4
daemon.c
@ -480,6 +480,8 @@ static int service_loop(int socknum, int *socklist)
|
|||||||
pfd[i].fd = socklist[i];
|
pfd[i].fd = socklist[i];
|
||||||
pfd[i].events = POLLIN;
|
pfd[i].events = POLLIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
signal(SIGCHLD, child_handler);
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
int i;
|
int i;
|
||||||
@ -518,8 +520,6 @@ static int serve(int port)
|
|||||||
{
|
{
|
||||||
int socknum, *socklist;
|
int socknum, *socklist;
|
||||||
|
|
||||||
signal(SIGCHLD, child_handler);
|
|
||||||
|
|
||||||
socknum = socksetup(port, &socklist);
|
socknum = socksetup(port, &socklist);
|
||||||
if (socknum == 0)
|
if (socknum == 0)
|
||||||
die("unable to allocate any listen sockets on port %u", port);
|
die("unable to allocate any listen sockets on port %u", port);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user