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:
parent
e76ce4484d
commit
70b939ecd3
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=261764
@ -1741,6 +1741,17 @@ sigterm_handler(int dummy __unused)
|
|||||||
sigterm_received = true;
|
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
|
static void
|
||||||
register_signals(void)
|
register_signals(void)
|
||||||
{
|
{
|
||||||
@ -1763,6 +1774,11 @@ register_signals(void)
|
|||||||
error = sigaction(SIGINT, &sa, NULL);
|
error = sigaction(SIGINT, &sa, NULL);
|
||||||
if (error != 0)
|
if (error != 0)
|
||||||
log_err(1, "sigaction");
|
log_err(1, "sigaction");
|
||||||
|
|
||||||
|
sa.sa_handler = sigchld_handler;
|
||||||
|
error = sigaction(SIGCHLD, &sa, NULL);
|
||||||
|
if (error != 0)
|
||||||
|
log_err(1, "sigaction");
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
Loading…
Reference in New Issue
Block a user