From a50c3be186ca26aaed94047973152916955684b4 Mon Sep 17 00:00:00 2001 From: Andy CA6JAU Date: Sun, 22 Jul 2018 20:35:15 -0400 Subject: [PATCH] Fix stderr messages at startup in DMR2NXDN, NXDN2DMR, YSF2NXDN and YSF2P25 --- DMR2NXDN/DMR2NXDN.cpp | 4 +++- NXDN2DMR/NXDN2DMR.cpp | 4 +++- YSF2NXDN/YSF2NXDN.cpp | 4 +++- YSF2P25/YSF2P25.cpp | 4 +++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/DMR2NXDN/DMR2NXDN.cpp b/DMR2NXDN/DMR2NXDN.cpp index 67cb14f..1571195 100644 --- a/DMR2NXDN/DMR2NXDN.cpp +++ b/DMR2NXDN/DMR2NXDN.cpp @@ -157,7 +157,6 @@ int CDMR2NXDN::run() ::close(STDIN_FILENO); ::close(STDOUT_FILENO); - ::close(STDERR_FILENO); // If we are currently root... if (getuid() == 0) { @@ -196,6 +195,9 @@ int CDMR2NXDN::run() return 1; } + if (m_daemon) + ::close(STDERR_FILENO); + m_defsrcid = m_conf.getDMRId(); std::string gatewayAddress = m_conf.getDstAddress(); diff --git a/NXDN2DMR/NXDN2DMR.cpp b/NXDN2DMR/NXDN2DMR.cpp index 74cb426..9244dd9 100644 --- a/NXDN2DMR/NXDN2DMR.cpp +++ b/NXDN2DMR/NXDN2DMR.cpp @@ -161,7 +161,6 @@ int CNXDN2DMR::run() ::close(STDIN_FILENO); ::close(STDOUT_FILENO); - ::close(STDERR_FILENO); // If we are currently root... if (getuid() == 0) { @@ -200,6 +199,9 @@ int CNXDN2DMR::run() return 1; } + if (m_daemon) + ::close(STDERR_FILENO); + m_callsign = m_conf.getCallsign(); m_nxdnTG = m_conf.getTG(); diff --git a/YSF2NXDN/YSF2NXDN.cpp b/YSF2NXDN/YSF2NXDN.cpp index 2560fbb..598ea4b 100644 --- a/YSF2NXDN/YSF2NXDN.cpp +++ b/YSF2NXDN/YSF2NXDN.cpp @@ -159,7 +159,6 @@ int CYSF2NXDN::run() ::close(STDIN_FILENO); ::close(STDOUT_FILENO); - ::close(STDERR_FILENO); //If we are currently root... if (getuid() == 0) { @@ -198,6 +197,9 @@ int CYSF2NXDN::run() return 1; } + if (m_daemon) + ::close(STDERR_FILENO); + m_callsign = m_conf.getCallsign(); m_suffix = m_conf.getSuffix(); m_defsrcid = m_conf.getNXDNId(); diff --git a/YSF2P25/YSF2P25.cpp b/YSF2P25/YSF2P25.cpp index e2b049b..1c1c8d1 100644 --- a/YSF2P25/YSF2P25.cpp +++ b/YSF2P25/YSF2P25.cpp @@ -211,7 +211,6 @@ int CYSF2P25::run() ::close(STDIN_FILENO); ::close(STDOUT_FILENO); - ::close(STDERR_FILENO); // If we are currently root... if (getuid() == 0) { @@ -250,6 +249,9 @@ int CYSF2P25::run() return 1; } + if (m_daemon) + ::close(STDERR_FILENO); + m_callsign = m_conf.getCallsign(); m_defsrcid = m_conf.getP25Id(); m_dstid = m_conf.getP25DstId();