Fix Windows compilation

This commit is contained in:
Andy CA6JAU 2018-07-27 23:42:04 -04:00
parent dd4be1354e
commit 5ba28e4771
6 changed files with 36 additions and 24 deletions

View File

@ -155,9 +155,6 @@ int CDMR2NXDN::run()
return -1;
}
::close(STDIN_FILENO);
::close(STDOUT_FILENO);
// If we are currently root...
if (getuid() == 0) {
struct passwd* user = ::getpwnam("mmdvm");
@ -195,8 +192,13 @@ int CDMR2NXDN::run()
return 1;
}
if (m_daemon)
#if !defined(_WIN32) && !defined(_WIN64)
if (m_daemon) {
::close(STDIN_FILENO);
::close(STDOUT_FILENO);
::close(STDERR_FILENO);
}
#endif
m_defsrcid = m_conf.getDMRId();

View File

@ -158,9 +158,6 @@ int CDMR2YSF::run()
return -1;
}
::close(STDIN_FILENO);
::close(STDOUT_FILENO);
// If we are currently root...
if (getuid() == 0) {
struct passwd* user = ::getpwnam("mmdvm");
@ -198,8 +195,13 @@ int CDMR2YSF::run()
return 1;
}
if (m_daemon)
#if !defined(_WIN32) && !defined(_WIN64)
if (m_daemon) {
::close(STDIN_FILENO);
::close(STDOUT_FILENO);
::close(STDERR_FILENO);
}
#endif
m_callsign = m_conf.getCallsign();
m_defsrcid = m_conf.getDMRId();

View File

@ -159,9 +159,6 @@ int CNXDN2DMR::run()
return -1;
}
::close(STDIN_FILENO);
::close(STDOUT_FILENO);
// If we are currently root...
if (getuid() == 0) {
struct passwd* user = ::getpwnam("mmdvm");
@ -199,8 +196,13 @@ int CNXDN2DMR::run()
return 1;
}
if (m_daemon)
#if !defined(_WIN32) && !defined(_WIN64)
if (m_daemon) {
::close(STDIN_FILENO);
::close(STDOUT_FILENO);
::close(STDERR_FILENO);
}
#endif
m_callsign = m_conf.getCallsign();
m_nxdnTG = m_conf.getTG();

View File

@ -165,9 +165,6 @@ int CYSF2DMR::run()
return -1;
}
::close(STDIN_FILENO);
::close(STDOUT_FILENO);
// If we are currently root...
if (getuid() == 0) {
struct passwd* user = ::getpwnam("mmdvm");
@ -205,8 +202,13 @@ int CYSF2DMR::run()
return 1;
}
if (m_daemon)
#if !defined(_WIN32) && !defined(_WIN64)
if (m_daemon) {
::close(STDIN_FILENO);
::close(STDOUT_FILENO);
::close(STDERR_FILENO);
}
#endif
m_callsign = m_conf.getCallsign();
m_suffix = m_conf.getSuffix();

View File

@ -157,9 +157,6 @@ int CYSF2NXDN::run()
return -1;
}
::close(STDIN_FILENO);
::close(STDOUT_FILENO);
//If we are currently root...
if (getuid() == 0) {
struct passwd* user = ::getpwnam("mmdvm");
@ -197,8 +194,13 @@ int CYSF2NXDN::run()
return 1;
}
if (m_daemon)
#if !defined(_WIN32) && !defined(_WIN64)
if (m_daemon) {
::close(STDIN_FILENO);
::close(STDOUT_FILENO);
::close(STDERR_FILENO);
}
#endif
m_callsign = m_conf.getCallsign();
m_suffix = m_conf.getSuffix();

View File

@ -209,9 +209,6 @@ int CYSF2P25::run()
return -1;
}
::close(STDIN_FILENO);
::close(STDOUT_FILENO);
// If we are currently root...
if (getuid() == 0) {
struct passwd* user = ::getpwnam("mmdvm");
@ -249,8 +246,13 @@ int CYSF2P25::run()
return 1;
}
if (m_daemon)
#if !defined(_WIN32) && !defined(_WIN64)
if (m_daemon) {
::close(STDIN_FILENO);
::close(STDOUT_FILENO);
::close(STDERR_FILENO);
}
#endif
m_callsign = m_conf.getCallsign();
m_defsrcid = m_conf.getP25Id();