From d7c2de4ee222767bf99c0ad481dacb16aec578d2 Mon Sep 17 00:00:00 2001 From: Stephen Roderick Date: Sat, 21 May 2011 08:45:51 -0400 Subject: [PATCH] Log error when unable to start a slave activity --- src/SlaveActivity.cpp | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-) diff --git a/src/SlaveActivity.cpp b/src/SlaveActivity.cpp index a61562d..caf2be4 100644 --- a/src/SlaveActivity.cpp +++ b/src/SlaveActivity.cpp @@ -38,6 +38,7 @@ #include "SlaveActivity.hpp" #include "os/MainThread.hpp" +#include "Logger.hpp" namespace RTT { @@ -97,8 +98,16 @@ namespace RTT bool SlaveActivity::start() { - if ( (mmaster && !mmaster->isActive()) || active == true ) + if (mmaster && !mmaster->isActive()) + { + Logger::log() << Logger::Error << "Unable to start slave as master activity is not running" << Logger::endl; return false; + } + if ( active == true ) + { + Logger::log() << Logger::Error << "Unable to start slave as it is already started" << Logger::endl; + return false; + } active = true; -- 1.7.4.4