diff --git a/MAC/APL/CURTDBDaemons/src/SoftwareMonitor/SoftwareMonitor.cc b/MAC/APL/CURTDBDaemons/src/SoftwareMonitor/SoftwareMonitor.cc index cd0b52641bd88f6769f8cbc5fe039ba2147224fb..83e1e6fe76a139570e9366edcd90e9cc752efe91 100644 --- a/MAC/APL/CURTDBDaemons/src/SoftwareMonitor/SoftwareMonitor.cc +++ b/MAC/APL/CURTDBDaemons/src/SoftwareMonitor/SoftwareMonitor.cc @@ -562,7 +562,6 @@ void SoftwareMonitor::_buildProcessMap() DIR* procDir = opendir("/proc"); ASSERTSTR(procDir, "Cannot open directory /proc to check programlist"); - chdir("/proc"); struct dirent* dirPtr; while ((dirPtr = readdir(procDir))) { @@ -680,7 +679,9 @@ void SoftwareMonitor::_restartProgram(const string& procName) } LOG_WARN_STR("Trying to restart program " << procName); - system (formatString("swlevel -r %s", procName.c_str()).c_str()); + if (system (formatString("swlevel -r %s", procName.c_str()).c_str()) != 0) { + LOG_ERROR_STR("Failed to restart program" << procName); + } } diff --git a/MAC/APL/RTCCommon/src/gnuplot_i.cc b/MAC/APL/RTCCommon/src/gnuplot_i.cc index bb09267e5322eca38074b95c90343fcc9dc2e63e..44326c403e5603e71678cc09864f2fd3cfb6e0f7 100644 --- a/MAC/APL/RTCCommon/src/gnuplot_i.cc +++ b/MAC/APL/RTCCommon/src/gnuplot_i.cc @@ -406,6 +406,7 @@ void gnuplot_plot_x( { int i ; int tmpfd ; + int retval; char name[128] ; char cmd[GP_CMD_SIZE] ; char line[GP_CMD_SIZE] ; @@ -434,7 +435,8 @@ void gnuplot_plot_x( /* Write data to this file */ for (i=0 ; i<n ; i++) { snprintf(line, sizeof line, "%g\n", d[i]); - write(tmpfd, line, strlen(line)); + retval=write(tmpfd, line, strlen(line)); + (void)retval; } close(tmpfd) ; diff --git a/MAC/APL/StationCU/src/BeamControl/BeamControl.cc b/MAC/APL/StationCU/src/BeamControl/BeamControl.cc index cc7235dc47f23ef00d2aa6348ccdadb0954c912b..b6b58bff3cd7565291624414b27c0dca24c2b256 100644 --- a/MAC/APL/StationCU/src/BeamControl/BeamControl.cc +++ b/MAC/APL/StationCU/src/BeamControl/BeamControl.cc @@ -253,7 +253,8 @@ GCFEvent::TResult BeamControl::initial_state(GCFEvent& event, itsParentControl->activateObservationTimers(msg.cntlrName, startTime, stopTime); LOG_INFO ("Killing running beamctl's if any"); - system ("killall beamctl"); + int retval = system ("killall beamctl"); + (void)retval; LOG_INFO ("Going to started state"); TRAN(BeamControl::started_state); // go to next state. diff --git a/MAC/APL/TestCtlr/src/ControllerMenu.cc b/MAC/APL/TestCtlr/src/ControllerMenu.cc index 95f171d43f2e2262c8bd27b31b9b69560d4468de..0f5b2b7d06e485bafee88ebce652a5441befda7f 100644 --- a/MAC/APL/TestCtlr/src/ControllerMenu.cc +++ b/MAC/APL/TestCtlr/src/ControllerMenu.cc @@ -552,7 +552,9 @@ void ControllerMenu::_doStartMenu() cout << "Its name has the format " << LOFAR_SHARE_LOCATION << "/Observation<nr>." << endl; string command("ls -1 " LOFAR_SHARE_LOCATION "/Observation[0-9]*"); - system(command.c_str()); + if (system(command.c_str()) != 0) { + cout << "Command '" << command << "' failed!" << endl; + } int32 obsnr(-1); while (obsnr < 0) {