diff --git a/lib/base/object.cpp b/lib/base/object.cpp index 51a850d37..fe91de5ac 100644 --- a/lib/base/object.cpp +++ b/lib/base/object.cpp @@ -67,7 +67,7 @@ bool Object::OwnsLock() const return (tid == GetCurrentThreadId()); #else /* _WIN32 */ - pthread_t tid = __sync_fetch_and_add(&m_LockOwner, nullptr); + pthread_t tid = __sync_fetch_and_add(&m_LockOwner, 0); return (tid == pthread_self()); #endif /* _WIN32 */ diff --git a/lib/base/perfdatavalue.cpp b/lib/base/perfdatavalue.cpp index 2c2829112..407f757f7 100644 --- a/lib/base/perfdatavalue.cpp +++ b/lib/base/perfdatavalue.cpp @@ -32,9 +32,6 @@ using namespace icinga; REGISTER_TYPE(PerfdataValue); REGISTER_SCRIPTFUNCTION_NS(System, parse_performance_data, PerfdataValue::Parse, "perfdata"); -PerfdataValue::PerfdataValue() -{ } - PerfdataValue::PerfdataValue(const String& label, double value, bool counter, const String& unit, const Value& warn, const Value& crit, const Value& min, const Value& max) diff --git a/lib/base/process.cpp b/lib/base/process.cpp index fbd7d1928..4f87ab3b5 100644 --- a/lib/base/process.cpp +++ b/lib/base/process.cpp @@ -506,22 +506,24 @@ void Process::InitializeSpawnHelper() static void InitializeProcess() { - for (auto& l_EventFD : l_EventFDs) { #ifdef _WIN32 - l_Events[tid] = CreateEvent(nullptr, TRUE, FALSE, nullptr); + for (auto& event : l_Events) { + event = CreateEvent(nullptr, TRUE, FALSE, nullptr); + } #else /* _WIN32 */ + for (auto& eventFD : l_EventFDs) { # ifdef HAVE_PIPE2 - if (pipe2(l_EventFDs[tid], O_CLOEXEC) < 0) { + if (pipe2(eventFD, O_CLOEXEC) < 0) { if (errno == ENOSYS) { # endif /* HAVE_PIPE2 */ - if (pipe(l_EventFD) < 0) { + if (pipe(eventFD) < 0) { BOOST_THROW_EXCEPTION(posix_error() << boost::errinfo_api_function("pipe") << boost::errinfo_errno(errno)); } - Utility::SetCloExec(l_EventFD[0]); - Utility::SetCloExec(l_EventFD[1]); + Utility::SetCloExec(eventFD[0]); + Utility::SetCloExec(eventFD[1]); # ifdef HAVE_PIPE2 } else { BOOST_THROW_EXCEPTION(posix_error() @@ -530,8 +532,8 @@ static void InitializeProcess() } } # endif /* HAVE_PIPE2 */ -#endif /* _WIN32 */ } +#endif /* _WIN32 */ } INITIALIZE_ONCE(InitializeProcess);