MFC r261764:

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:
trasz 2014-03-25 12:24:18 +00:00
parent 5fb75e3b8f
commit b25383a8f9

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