diff options
author | trasz <trasz@FreeBSD.org> | 2014-03-25 12:24:18 +0000 |
---|---|---|
committer | trasz <trasz@FreeBSD.org> | 2014-03-25 12:24:18 +0000 |
commit | b25383a8f96c54eb2828c68551a617758bdbee41 (patch) | |
tree | b2b78f7875f0744a84ba2379f071c6e5bcafe70b /usr.sbin/ctld | |
parent | 5fb75e3b8f09c689ffcda3c05dad773f6f6625f2 (diff) | |
download | FreeBSD-src-b25383a8f96c54eb2828c68551a617758bdbee41.zip FreeBSD-src-b25383a8f96c54eb2828c68551a617758bdbee41.tar.gz |
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
Diffstat (limited to 'usr.sbin/ctld')
-rw-r--r-- | usr.sbin/ctld/ctld.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/usr.sbin/ctld/ctld.c b/usr.sbin/ctld/ctld.c index d082227..56092db 100644 --- a/usr.sbin/ctld/ctld.c +++ b/usr.sbin/ctld/ctld.c @@ -1742,6 +1742,17 @@ sigterm_handler(int dummy __unused) } 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) { struct sigaction sa; @@ -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 |