mirror of
https://github.com/optim-enterprises-bv/nDPId.git
synced 2025-10-29 17:32:23 +00:00
bump libnDPI to 6b7e5fa8d251f11c1bae16ea892a43a92b098480
* fixed linking issue by using CMake to check if explicit link against libm required * make nDPIsrvd collectd exit if parent pid changed, meaning that collectd died somehow * nDPId-test restores SIGPIPE to the default handler (termination), so abnormal connection drop's do now have consequences Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
static struct nDPIsrvd_socket * sock = NULL;
|
||||
static int main_thread_shutdown = 0;
|
||||
static int collectd_timerfd = -1;
|
||||
static pid_t collectd_pid;
|
||||
|
||||
static char * serv_optarg = NULL;
|
||||
static char * collectd_hostname = NULL;
|
||||
@@ -364,6 +365,16 @@ static int mainloop(int epollfd)
|
||||
{
|
||||
uint64_t expirations;
|
||||
|
||||
/*
|
||||
* Check if collectd parent process is still running.
|
||||
* May happen if collectd was killed with singals e.g. SIGKILL.
|
||||
*/
|
||||
if (getppid() != collectd_pid)
|
||||
{
|
||||
LOG(LOG_DAEMON | LOG_ERR, "Parent process %d exited. Nothing left to do here, bye.", collectd_pid);
|
||||
return 1;
|
||||
}
|
||||
|
||||
errno = 0;
|
||||
if (read(collectd_timerfd, &expirations, sizeof(expirations)) != sizeof(expirations))
|
||||
{
|
||||
@@ -693,6 +704,8 @@ int main(int argc, char ** argv)
|
||||
signal(SIGTERM, sighandler);
|
||||
signal(SIGPIPE, SIG_IGN);
|
||||
|
||||
collectd_pid = getppid();
|
||||
|
||||
int epollfd = epoll_create1(0);
|
||||
if (epollfd < 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user