diff --git a/BaseCommon/Daemon.cpp b/BaseCommon/Daemon.cpp index 27978c9..f0d6335 100644 --- a/BaseCommon/Daemon.cpp +++ b/BaseCommon/Daemon.cpp @@ -75,6 +75,10 @@ DAEMONIZE_RESULT CDaemon::daemonize(const std::string& pidFile) return DR_PARENT; } + if (setsid() < 0) { + return DR_FAILURE; + } + /* Set new file permissions */ umask(0);