From 6495912d9aae127873a87e725c085f8065276257 Mon Sep 17 00:00:00 2001 From: Reijo Tomperi Date: Sun, 1 Mar 2009 19:34:32 +0000 Subject: [PATCH] Fixed bug, -j option produced duplicate error messages. --- src/threadexecutor.cpp | 9 ++++++++- src/threadexecutor.h | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/threadexecutor.cpp b/src/threadexecutor.cpp index 2550d6d50..edb07a37d 100644 --- a/src/threadexecutor.cpp +++ b/src/threadexecutor.cpp @@ -71,7 +71,14 @@ bool ThreadExecutor::handleRead(unsigned int &result) { ErrorLogger::ErrorMessage msg; msg.deserialize(buf); - _errorLogger.reportErr(msg); + + // Alert only about unique errors + std::string errmsg = msg.toText(); + if (std::find(_errorList.begin(), _errorList.end(), errmsg) == _errorList.end()) + { + _errorList.push_back(errmsg); + _errorLogger.reportErr(msg); + } } else if (type == '3') { diff --git a/src/threadexecutor.h b/src/threadexecutor.h index 53f79d04d..d48aabe5b 100644 --- a/src/threadexecutor.h +++ b/src/threadexecutor.h @@ -22,6 +22,7 @@ #include #include +#include #include "settings.h" #include "errorlogger.h" @@ -50,6 +51,7 @@ private: bool handleRead(unsigned int &result); void writeToPipe(char type, const std::string &data); int _pipe[2]; + std::list _errorList; public: /** * @return true if support for threads exist.