Module: check_mk
Branch: master
Commit: 8ca436d7297d4a6db0212c4e47192c38a6413a57
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8ca436d7297d4a…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Mon Jan 9 15:08:55 2017 +0100
Fetched livestatus from downstream.
Change-Id: I481e31f5944da25860e73950ba69f5ac29a6c008
---
livestatus/configure.ac | 2 +-
livestatus/src/HostServiceState.h | 6 ++++--
livestatus/src/TableStateHistory.cc | 16 ++++++++++++++--
3 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/livestatus/configure.ac b/livestatus/configure.ac
index 9af8614..56c5378 100644
--- a/livestatus/configure.ac
+++ b/livestatus/configure.ac
@@ -97,7 +97,7 @@ AC_FUNC_REALLOC
AC_FUNC_SELECT_ARGTYPES
AC_TYPE_SIGNAL
AC_FUNC_STAT
-AC_CHECK_FUNCS([bzero gettimeofday memmove regcomp select socket strcasecmp strdup
strerror strtoul])
+AC_CHECK_FUNCS([gettimeofday memmove select socket strcasecmp strdup strerror strtoul])
AC_ARG_WITH(nagios4,AC_HELP_STRING([--with-nagios4],[enabled compilation for nagios 4]),
[
CPPFLAGS="${CFLAGS} -DNAGIOS4"
diff --git a/livestatus/src/HostServiceState.h b/livestatus/src/HostServiceState.h
index bdfd35d..94f688c 100644
--- a/livestatus/src/HostServiceState.h
+++ b/livestatus/src/HostServiceState.h
@@ -47,16 +47,18 @@ public:
time_t _duration;
double _duration_part;
- // Do not change order within this block!
- // These durations will be bzero'd
time_t _duration_state_UNMONITORED;
double _duration_part_UNMONITORED;
+
time_t _duration_state_OK;
double _duration_part_OK;
+
time_t _duration_state_WARNING;
double _duration_part_WARNING;
+
time_t _duration_state_CRITICAL;
double _duration_part_CRITICAL;
+
time_t _duration_state_UNKNOWN;
double _duration_part_UNKNOWN;
diff --git a/livestatus/src/TableStateHistory.cc b/livestatus/src/TableStateHistory.cc
index ab4694b..e7f85ad 100644
--- a/livestatus/src/TableStateHistory.cc
+++ b/livestatus/src/TableStateHistory.cc
@@ -939,8 +939,20 @@ void TableStateHistory::process(Query *query, HostServiceState
*hs_state) {
hs_state->_duration_part = static_cast<double>(hs_state->_duration) /
static_cast<double>(_query_timeframe);
- bzero(&hs_state->_duration_state_UNMONITORED,
- sizeof(time_t) * 5 + sizeof(double) * 5);
+ hs_state->_duration_state_UNMONITORED = 0;
+ hs_state->_duration_part_UNMONITORED = 0;
+
+ hs_state->_duration_state_OK = 0;
+ hs_state->_duration_part_OK = 0;
+
+ hs_state->_duration_state_WARNING = 0;
+ hs_state->_duration_part_WARNING = 0;
+
+ hs_state->_duration_state_CRITICAL = 0;
+ hs_state->_duration_part_CRITICAL = 0;
+
+ hs_state->_duration_state_UNKNOWN = 0;
+ hs_state->_duration_part_UNKNOWN = 0;
switch (hs_state->_state) {
case -1: