naemon / naemon-livestatus

Naemon - Livestatus Eventbroker Module
GNU General Public License v2.0
26 stars 30 forks source link

fix EL8 crash #72

Closed pbiering closed 4 years ago

pbiering commented 4 years ago

this finally fixes https://github.com/naemon/naemon-livestatus/issues/70

jacobbaungard commented 4 years ago

Hi @pbiering , thanks a lot for sending this in.

As I understand it, this PR, includes the changes in #71, so we can close that PR right?

Some comments:

pbiering commented 4 years ago

yes, https://github.com/naemon/naemon-livestatus/pull/71 has included this PR, this was not intended...

the 2 real bugs are kind of

-    if(abs(_opid == OP_EQUAL) && _ref_host == "")
+   if(abs(_opid) == OP_EQUAL && _ref_host == "") // bugfix (found by clang warning -Wabsolute-value)

such "if" cases are occuring more often in the code, 2 of them had paranthesis typos.

Regarding the Travis CI check

LogEntryTest.cc: In member function ‘void LogEntryTest::testParserHostState()’:

LogEntryTest.cc:28:2: error: no matching function for call to ‘assertEquals(unsigned int, int&, CppUnit::SourceLine, const char [1])’

this is potentially related to LogCache.h:

+    unsigned     _logclass;
+    int          _logclass; // satisfy -Wsign-compare

but strange, as I've tested compilation on EL6, EL7 and EL8 and did not get this error (EL8 also with "clang") - must be related to Ubuntu somehow.

Can you exclude this particular one and retry Travis CI?

pbiering commented 4 years ago

replaced by https://github.com/naemon/naemon-livestatus/pull/73