Skip to content

Commit 9220282

Browse files
author
H. Peter Anvin
committed
Move signal setting into service_loop()
1 parent 7626e49 commit 9220282

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

daemon.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,8 @@ static int service_loop(int socknum, int *socklist)
480480
pfd[i].fd = socklist[i];
481481
pfd[i].events = POLLIN;
482482
}
483+
484+
signal(SIGCHLD, child_handler);
483485

484486
for (;;) {
485487
int i;
@@ -518,8 +520,6 @@ static int serve(int port)
518520
{
519521
int socknum, *socklist;
520522

521-
signal(SIGCHLD, child_handler);
522-
523523
socknum = socksetup(port, &socklist);
524524
if (socknum == 0)
525525
die("unable to allocate any listen sockets on port %u", port);

0 commit comments

Comments
 (0)