]> git.ipfire.org Git - thirdparty/lldpd.git/commit
priv: correctly handle lldpcli exit
authorVincent Bernat <vincent@bernat.im>
Fri, 20 Oct 2017 06:42:01 +0000 (08:42 +0200)
committerVincent Bernat <vincent@bernat.im>
Fri, 20 Oct 2017 09:05:36 +0000 (11:05 +0200)
commit635724519137dde5adc749f6320f225373fd63d5
treef6e9bcbc4e0201467f021c3ef9c63f30e89d02f9
parent1602c2246fbb01f50ace2e6f83b4e76d20d95adc
priv: correctly handle lldpcli exit

When lldpcli exits, we must acknowledge its death with
`waitpid()`. There were two missing cases:

 - when lldpcli exits before setting the SIG_CHLD signal
 - when privilege separation was not configured

For the first case, we call the function associated to the signal
ourselves after the signal is configured. This function is idempotent.

For the second case, we setup the SIG_CHLD signal even when privilege
separation is disabled.

Fix #250
src/daemon/priv.c