BUG/MINOR: mworker: properly pass SIGTTOU/SIGTTIN to workers

If a new process is started with -sf and it fails to bind, it may send
a SIGTTOU to the master process in hope that it will temporarily unbind.
Unfortunately this one doesn't catch it and stops to background instead
of forwarding the signal to the workers. The same is true for SIGTTIN.

This commit simply implements an extra signal handler for the master to
deal with such signals that must be passed down to the workers. It must
be backported as far as 1.8, though there the code differs in that it's
entirely in haproxy.c and doesn't require an extra sig handler.

(cherry picked from commit d26c9f9465de24d2414f4a46653fc20fd2871ac4)
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit b97a22aa43aaebca207e52c8c80a6b85de4a25d4)
Signed-off-by: Willy Tarreau <w@1wt.eu>
diff --git a/src/mworker.c b/src/mworker.c
index 511d961..ff3e16b 100644
--- a/src/mworker.c
+++ b/src/mworker.c
@@ -204,6 +204,8 @@
 	sigemptyset(&set);
 	sigaddset(&set, SIGUSR1);
 	sigaddset(&set, SIGUSR2);
+	sigaddset(&set, SIGTTIN);
+	sigaddset(&set, SIGTTOU);
 	sigaddset(&set, SIGHUP);
 	sigaddset(&set, SIGCHLD);
 	ha_sigmask(SIG_SETMASK, &set, NULL);
@@ -216,6 +218,12 @@
 
 /* ----- mworker signal handlers ----- */
 
+/* broadcast the configured signal to the workers */
+void mworker_broadcast_signal(struct sig_handler *sh)
+{
+	mworker_kill(sh->arg);
+}
+
 /*
  * When called, this function reexec haproxy with -sf followed by current
  * children PIDs and possibly old children PIDs if they didn't leave yet.