From aefe4dd0bfe546bcf2cfe5fde2430c83718c540c Mon Sep 17 00:00:00 2001 From: Gleb Smirnoff Date: Thu, 28 Dec 2017 10:36:36 -0800 Subject: [PATCH] With current forking model of minidlna, we no longer need the event module in the child, so shut it down. While here, make any error from fork() a fatal error. --- process.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/process.c b/process.c index ecb4922..abb777b 100644 --- a/process.c +++ b/process.c @@ -38,9 +38,10 @@ #include #include +#include "config.h" +#include "event.h" #include "upnpglobalvars.h" #include "process.h" -#include "config.h" #include "log.h" struct child *children = NULL; @@ -100,7 +101,10 @@ process_fork(struct client_cache_s *client) client->connections++; add_process_info(pid, client); number_of_children++; - } + } else if (pid == 0) + event_module.fini(); + else + DPRINTF(E_FATAL, L_GENERAL, "Fork() failed: %s\n", strerror(errno)); return pid; }