From d0143b4e7f0c71ffbc2f7b0914e33b86db2ebca6 Mon Sep 17 00:00:00 2001
From: Marcel Loose <loose@astron.nl>
Date: Tue, 18 Dec 2012 10:37:41 +0000
Subject: [PATCH] =?UTF-8?q?Task=20#3942:=20Fixed=20warning:=20ignoring=20r?=
 =?UTF-8?q?eturn=20value=20of=20=E2=80=98foo()=E2=80=99,=20declared=20with?=
 =?UTF-8?q?=20attribute=20warn=5Funused=5Fresult=20[-Wunused-result]?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 MAC/APL/CURTDBDaemons/src/SoftwareMonitor/SoftwareMonitor.cc | 5 +++--
 MAC/APL/RTCCommon/src/gnuplot_i.cc                           | 4 +++-
 MAC/APL/StationCU/src/BeamControl/BeamControl.cc             | 3 ++-
 MAC/APL/TestCtlr/src/ControllerMenu.cc                       | 4 +++-
 4 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/MAC/APL/CURTDBDaemons/src/SoftwareMonitor/SoftwareMonitor.cc b/MAC/APL/CURTDBDaemons/src/SoftwareMonitor/SoftwareMonitor.cc
index cd0b52641bd..83e1e6fe76a 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 bb09267e532..44326c403e5 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 cc7235dc47f..b6b58bff3cd 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 95f171d43f2..0f5b2b7d06e 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) {
-- 
GitLab