mirror of
https://github.com/g4klx/DAPNETGateway.git
synced 2026-08-26 12:32:45 -04:00
Close the fds after the log initialisation.
This commit is contained in:
parent
590916734e
commit
fd609b0eb1
1 changed files with 8 additions and 4 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue