So, it turns out SIGCHLD is discarded by default, so we have to set up

a dummy handler to make it interrupt an ioctl(2) or select(2).

This makes those short-lived ctld(8) zombies disappear.

Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Edward Tomasz Napierala 2014-02-11 11:33:44 +00:00
parent e76ce4484d
commit 70b939ecd3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=261764

View File

@ -1741,6 +1741,17 @@ sigterm_handler(int dummy __unused)
sigterm_received = true;
}
static void
sigchld_handler(int dummy __unused)
{
/*
* The only purpose of this handler is to make SIGCHLD
* interrupt the ISCSIDWAIT ioctl(2), so we can call
* wait_for_children().
*/
}
static void
register_signals(void)
{
@ -1763,6 +1774,11 @@ register_signals(void)
error = sigaction(SIGINT, &sa, NULL);
if (error != 0)
log_err(1, "sigaction");
sa.sa_handler = sigchld_handler;
error = sigaction(SIGCHLD, &sa, NULL);
if (error != 0)
log_err(1, "sigaction");
}
int