From 26c6665308b5a99d02308099118b23b2716dacc0 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Thu, 6 Aug 2009 15:20:23 +0200 Subject: fix a case when we print a warning twice. Signed-off-by: Denys Vlasenko --- lib/Plugins/CCpp.cpp | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'lib/Plugins/CCpp.cpp') diff --git a/lib/Plugins/CCpp.cpp b/lib/Plugins/CCpp.cpp index 026e15a..a47ca38 100644 --- a/lib/Plugins/CCpp.cpp +++ b/lib/Plugins/CCpp.cpp @@ -527,19 +527,20 @@ void CAnalyzerCCpp::Init() } if (m_sOldCorePattern[0] == '|') { - if (m_sOldCorePattern == CORE_PATTERN) - { - log("warning: %s already contains %s, " - "did abrt daemon crash recently?", - CORE_PATTERN_IFACE, CORE_PATTERN); - /* There is no point in "restoring" CORE_PATTERN_IFACE - * to CORE_PATTERN on exit. Will restore to a default value: - */ - m_sOldCorePattern = "core"; - } - log("warning: %s was already set to run a crash analyser (%s), " - "abrt may interfere with it", - CORE_PATTERN_IFACE, CORE_PATTERN); + if (m_sOldCorePattern == CORE_PATTERN) + { + log("warning: %s already contains %s, " + "did abrt daemon crash recently?", + CORE_PATTERN_IFACE, CORE_PATTERN); + /* There is no point in "restoring" CORE_PATTERN_IFACE + * to CORE_PATTERN on exit. Will restore to a default value: + */ + m_sOldCorePattern = "core"; + } else { + log("warning: %s was already set to run a crash analyser (%s), " + "abrt may interfere with it", + CORE_PATTERN_IFACE, CORE_PATTERN); + } } std::ofstream fOutCorePattern; -- cgit