From 6e251251f069f2f2e727283423c6de1ea4e64136 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Mon, 18 Mar 2013 11:59:26 +0100 Subject: [PATCH] Fix example time period. --- lib/base/script.cpp | 5 +++-- lib/icinga/perfdatawriter.cpp | 2 +- lib/icinga/timeperiod.cpp | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/base/script.cpp b/lib/base/script.cpp index 405c660a4..17fdffe92 100644 --- a/lib/base/script.cpp +++ b/lib/base/script.cpp @@ -22,6 +22,7 @@ #include "base/dynamictype.h" #include "base/logger_fwd.h" #include "base/objectlock.h" +#include "base/utility.h" using namespace icinga; @@ -44,7 +45,7 @@ Script::Script(const Dictionary::Ptr& serializedUpdate) */ void Script::Start(void) { - assert(OwnsLock()); + ASSERT(OwnsLock()); SpawnInterpreter(); } @@ -74,7 +75,7 @@ String Script::GetCode(void) const */ void Script::OnAttributeUpdate(const String& name) { - assert(!OwnsLock()); + ASSERT(!OwnsLock()); if (name == "language" || name == "code") SpawnInterpreter(); diff --git a/lib/icinga/perfdatawriter.cpp b/lib/icinga/perfdatawriter.cpp index 3e866b4f3..c6131ef7c 100644 --- a/lib/icinga/perfdatawriter.cpp +++ b/lib/icinga/perfdatawriter.cpp @@ -49,7 +49,7 @@ PerfdataWriter::~PerfdataWriter(void) */ void PerfdataWriter::OnAttributeChanged(const String& name) { - assert(!OwnsLock()); + ASSERT(!OwnsLock()); if (name == "rotation_interval") { m_RotationTimer->SetInterval(GetRotationInterval()); diff --git a/lib/icinga/timeperiod.cpp b/lib/icinga/timeperiod.cpp index 14b518de1..821d59a45 100644 --- a/lib/icinga/timeperiod.cpp +++ b/lib/icinga/timeperiod.cpp @@ -329,7 +329,7 @@ void TimePeriod::EvenMinutesTimePeriodUpdate(const ScriptTask::Ptr& task, const if ((t % 2) == 0) { Dictionary::Ptr segment = boost::make_shared(); segment->Set("begin", t * 60); - segment->Set("end", t * 61); + segment->Set("end", (t + 1) * 60); segments->Add(segment); }