Module: check_mk
Branch: master
Commit: 52e0bb8f12e2594a9aaebbfd23669507799e91e0
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=52e0bb8f12e259…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Mon Sep 3 12:37:50 2018 +0200
Abort when an unknown timeperiod is used.
This should never happen, and it is better to terminate with a sensible log
message than to crash later at an unknown moment.
Some const-correctness fixes on the way.
Change-Id: Ibb734dc9ac79d084f375072559e7d9d1534f4464
---
livestatus/src/HostSpecialDoubleColumn.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/livestatus/src/HostSpecialDoubleColumn.cc
b/livestatus/src/HostSpecialDoubleColumn.cc
index e8b33be..02a680f 100644
--- a/livestatus/src/HostSpecialDoubleColumn.cc
+++ b/livestatus/src/HostSpecialDoubleColumn.cc
@@ -64,7 +64,7 @@ double HostSpecialDoubleColumn::getValue(Row row) const {
double HostSpecialDoubleColumn::staleness(const Object *object) {
auto state = object->state();
std::chrono::system_clock::duration check_result_age;
- Timeperiod *check_period = object->_check_period;
+ const Timeperiod *check_period = object->_check_period;
std::chrono::system_clock::time_point last_period_change =
check_period->lastStateChange();
std::chrono::system_clock::time_point last_check = state->_last_check;