mirror of
https://github.com/oe7drt/YSFClients.git
synced 2026-04-07 07:14:09 +00:00
Close the fds after log initialisation.
This commit is contained in:
parent
51d534034b
commit
01d88248c7
2 changed files with 16 additions and 8 deletions
|
|
@ -117,10 +117,6 @@ void CYSFReflector::run()
|
|||
return;
|
||||
}
|
||||
|
||||
::close(STDIN_FILENO);
|
||||
::close(STDOUT_FILENO);
|
||||
::close(STDERR_FILENO);
|
||||
|
||||
// If we are currently root...
|
||||
if (getuid() == 0) {
|
||||
struct passwd* user = ::getpwnam("mmdvm");
|
||||
|
|
@ -158,6 +154,14 @@ void CYSFReflector::run()
|
|||
return;
|
||||
}
|
||||
|
||||
#if !defined(_WIN32) && !defined(_WIN64)
|
||||
if (m_daemon) {
|
||||
::close(STDIN_FILENO);
|
||||
::close(STDOUT_FILENO);
|
||||
::close(STDERR_FILENO);
|
||||
}
|
||||
#endif
|
||||
|
||||
CNetwork network(m_conf.getNetworkPort(), m_conf.getName(), m_conf.getDescription(), m_conf.getNetworkDebug());
|
||||
|
||||
ret = network.open();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue