diff --git a/RELEASE.txt b/RELEASE.txt index 7d5292849..92ddc5c29 100644 --- a/RELEASE.txt +++ b/RELEASE.txt @@ -30,6 +30,7 @@ This document describes the differences between v7.x.x and v7.0.0 - moench being made compatible with jungfrau 2.0 boards (jungfrau structure, away from ctb) - eiger febl and feb in versions +- fixed rx_arping error - fix hdf5 compilation (detspec fields) diff --git a/slsReceiverSoftware/src/Arping.cpp b/slsReceiverSoftware/src/Arping.cpp index 98c2c2993..edc1f4b93 100644 --- a/slsReceiverSoftware/src/Arping.cpp +++ b/slsReceiverSoftware/src/Arping.cpp @@ -7,6 +7,7 @@ #include #include #include +#include namespace sls { @@ -16,6 +17,10 @@ namespace sls { #define gettid() syscall(SYS_gettid) #endif +void func(int signum) { + wait(NULL); +} + Arping::Arping() {} Arping::~Arping() { @@ -44,10 +49,11 @@ pid_t Arping::GetProcessId() const { return childPid; } bool Arping::IsRunning() const { return runningFlag; } void Arping::StartProcess() { - TestCommands(); - // to prevent zombies from child processes being killed - signal(SIGCHLD, SIG_IGN); + signal(SIGCHLD, func); + + // test once to throw exception if arping failed + TestForErrors(); // Needs to be a fork and udp socket deleted after Listening threads // done running to prevent udp socket cannot bind because of popen @@ -90,7 +96,7 @@ void Arping::ProcessExecution() { } } -void Arping::TestCommands() { +void Arping::TestForErrors() { // atleast one interface must be set up if (commands[0].empty()) { throw RuntimeError( @@ -116,7 +122,7 @@ std::string Arping::ExecuteCommands() { FILE *sysFile = popen(cmd.c_str(), "r"); if (sysFile == NULL) { std::ostringstream os; - os << "Could not Arping [" << cmd << " ] : Popen fail"; + os << "Could not Arping (" << cmd << " ) : Popen fail (" << strerror(errno) << ')'; return os.str(); } @@ -128,7 +134,7 @@ std::string Arping::ExecuteCommands() { // check exit status of command if (pclose(sysFile)) { std::ostringstream os; - os << "Could not arping[" << cmd << "] : " << output; + os << "Could not arping (" << cmd << ") : " << strerror(errno); return os.str(); } else { LOG(logDEBUG) << output; diff --git a/slsReceiverSoftware/src/Arping.h b/slsReceiverSoftware/src/Arping.h index bd6ea21a6..96172f76c 100644 --- a/slsReceiverSoftware/src/Arping.h +++ b/slsReceiverSoftware/src/Arping.h @@ -28,7 +28,7 @@ class Arping { void StopProcess(); private: - void TestCommands(); + void TestForErrors(); std::string ExecuteCommands(); void ProcessExecution();