Close the fds after the log initialisation.

This commit is contained in:
Jonathan Naylor 2018-07-26 18:33:08 +01:00
parent 590916734e
commit fd609b0eb1

View file

@ -154,10 +154,6 @@ int CDAPNETGateway::run()
return -1;
}
::close(STDIN_FILENO);
::close(STDOUT_FILENO);
::close(STDERR_FILENO);
// If we are currently root...
if (getuid() == 0) {
struct passwd* user = ::getpwnam("mmdvm");
@ -195,6 +191,14 @@ int CDAPNETGateway::run()
return 1;
}
#if !defined(_WIN32) && !defined(_WIN64)
if (m_daemon) {
::close(STDIN_FILENO);
::close(STDOUT_FILENO);
::close(STDERR_FILENO);
}
#endif
bool debug = m_conf.getDAPNETDebug();
std::string rptAddress = m_conf.getRptAddress();