]> git.ipfire.org Git - thirdparty/lldpd.git/commit
priv: correctly handle lldpcli exit fix/reap-children-2 252/head
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 06:52:27 +0000 (08:52 +0200)
commit6939cd1e54e5019c9681019a451ab0d97a0d299f
tree448ab0c917a9b3e4d432f85e709ea6a64b7bd030
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

To fix both cases, we ask the OS to reap children for us. We know when
monitored process dies because we are unable to read from pipe (no
need for a signal).

To fix the first case, we just reap any existing dead child after
setting the signal.

Fix #250
src/daemon/priv.c