mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 08:43:19 -04:00
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
1 changed files with 16 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue