diff options
-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 |