ldpd: ignore the SIGHUP signal in the child processes

Only the parent process should handle the SIGHUP signal, but we need
to make sure that this signal is ignored in the child processes so a
command like "killall -SIGHUP ldpd" won't kill ldpd.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
This commit is contained in:
Renato Westphal 2017-03-25 21:28:13 -03:00
parent 56b8a8d231
commit 1e7e440f5a
3 changed files with 10 additions and 1 deletions

View File

@ -105,6 +105,10 @@ sigint(void)
static struct quagga_signal_t lde_signals[] =
{
{
.signal = SIGHUP,
/* ignore */
},
{
.signal = SIGINT,
.handler = &sigint,

View File

@ -87,6 +87,10 @@ sigint(void)
static struct quagga_signal_t ldpe_signals[] =
{
{
.signal = SIGHUP,
/* ignore */
},
{
.signal = SIGINT,
.handler = &sigint,

View File

@ -108,7 +108,8 @@ quagga_sigevent_process (void)
if (sig->caught > 0)
{
sig->caught = 0;
sig->handler ();
if (sig->handler)
sig->handler ();
}
}
}