naemon/naemon-core — pull request #32 by ricardomaraschini (2014-01-30 16:31:31+00:00)
Title: utils.c: setting state to UNKNOWN in case of killed by signal

on my_system_r() we had a bug if process being executed by
popen() dies by a signal. previously if process being executed
by popen() died by signal we treat the return as OK.

with this change we verify if process on popen() died by a
signal and then we kill ourselves with the very same signal
in order to detect on parent process the unexpected end of the
command. as in child we already called reset_sighandler(), we
ensure that we gonna be killed and no sighandler will be set
at all when `suicide' time arrive.

Signed-off-by: Ricardo Maraschini