diff --git a/lib/base/exception.cpp b/lib/base/exception.cpp index 468f4fc5c..2ed0ebbbc 100644 --- a/lib/base/exception.cpp +++ b/lib/base/exception.cpp @@ -134,8 +134,6 @@ String icinga::DiagnosticInformation(const std::exception& ex, bool verbose, Sta { std::ostringstream result; - const user_error *uex = dynamic_cast(&ex); - String message = ex.what(); if (message.IsEmpty()) @@ -150,9 +148,10 @@ String icinga::DiagnosticInformation(const std::exception& ex, bool verbose, Sta ShowCodeFragment(result, dex->GetDebugInfo()); } + const user_error *uex = dynamic_cast(&ex); const posix_error *pex = dynamic_cast(&ex); - if (!uex && verbose) { + if (!uex && !pex && verbose) { const StackTrace *st = boost::get_error_info(ex); if (st) { diff --git a/lib/base/timer.cpp b/lib/base/timer.cpp index 916c50a9a..bb522f8ae 100644 --- a/lib/base/timer.cpp +++ b/lib/base/timer.cpp @@ -226,8 +226,8 @@ void Timer::AdjustTimers(double adjustment) std::vector timers; BOOST_FOREACH(Timer *timer, idx) { - if (abs(now - (timer->m_Next + adjustment)) < - abs(now - timer->m_Next)) { + if (std::fabs(now - (timer->m_Next + adjustment)) < + std::fabs(now - timer->m_Next)) { timer->m_Next += adjustment; timers.push_back(timer); } diff --git a/lib/base/workqueue.cpp b/lib/base/workqueue.cpp index 1d2bfeea4..50b0f6a11 100644 --- a/lib/base/workqueue.cpp +++ b/lib/base/workqueue.cpp @@ -33,7 +33,7 @@ int WorkQueue::m_NextID = 1; boost::thread_specific_ptr l_ThreadWorkQueue; WorkQueue::WorkQueue(size_t maxItems, int threadCount) - : m_ID(m_NextID++), m_MaxItems(maxItems), m_ThreadCount(threadCount), m_Spawned(false), m_Stopped(false), + : m_ID(m_NextID++), m_ThreadCount(threadCount), m_Spawned(false), m_MaxItems(maxItems), m_Stopped(false), m_Processing(0) { m_StatusTimer = new Timer();