Skip to content

Commit

Permalink
Move signal setting into service_loop()
Browse files Browse the repository at this point in the history
  • Loading branch information
H. Peter Anvin committed Sep 30, 2005
1 parent 7626e49 commit 9220282
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions daemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 9220282

Please sign in to comment.