Build fix

This commit is contained in:
Gunnar Beutner 2018-01-04 10:46:35 +01:00
parent f05459b40c
commit 71ee5ac698
3 changed files with 10 additions and 11 deletions

View File

@ -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 */

View File

@ -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)

View File

@ -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);