In a future change, the flags used for processing SIGCHLD will need to
be updated, which is only possible by using sigaction().
Replace the call, which hs the added benefit of using BSD semantics
reliably and therefore not needing the rearming call.
Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
/*
* Otherwise empty handler because systemcalls will get interrupted
* upon signal receipt
- * SysV needs the handler to be rearmed
*/
- signal(SIGCHLD, child_handler);
}
static int set_reuse_addr(int sockfd)
static int service_loop(struct socketlist *socklist)
{
struct pollfd *pfd;
+ struct sigaction sa;
CALLOC_ARRAY(pfd, socklist->nr);
pfd[i].events = POLLIN;
}
- signal(SIGCHLD, child_handler);
+ sigemptyset(&sa.sa_mask);
+ sa.sa_flags = SA_NOCLDSTOP | SA_RESTART;
+ sa.sa_handler = child_handler;
+ sigaction(SIGCHLD, &sa, NULL);
for (;;) {
check_dead_children();