mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-23 13:45:04 +02:00
Build fix
This commit is contained in:
parent
f05459b40c
commit
71ee5ac698
@ -67,7 +67,7 @@ bool Object::OwnsLock() const
|
|||||||
|
|
||||||
return (tid == GetCurrentThreadId());
|
return (tid == GetCurrentThreadId());
|
||||||
#else /* _WIN32 */
|
#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());
|
return (tid == pthread_self());
|
||||||
#endif /* _WIN32 */
|
#endif /* _WIN32 */
|
||||||
|
@ -32,9 +32,6 @@ using namespace icinga;
|
|||||||
REGISTER_TYPE(PerfdataValue);
|
REGISTER_TYPE(PerfdataValue);
|
||||||
REGISTER_SCRIPTFUNCTION_NS(System, parse_performance_data, PerfdataValue::Parse, "perfdata");
|
REGISTER_SCRIPTFUNCTION_NS(System, parse_performance_data, PerfdataValue::Parse, "perfdata");
|
||||||
|
|
||||||
PerfdataValue::PerfdataValue()
|
|
||||||
{ }
|
|
||||||
|
|
||||||
PerfdataValue::PerfdataValue(const String& label, double value, bool counter,
|
PerfdataValue::PerfdataValue(const String& label, double value, bool counter,
|
||||||
const String& unit, const Value& warn, const Value& crit, const Value& min,
|
const String& unit, const Value& warn, const Value& crit, const Value& min,
|
||||||
const Value& max)
|
const Value& max)
|
||||||
|
@ -506,22 +506,24 @@ void Process::InitializeSpawnHelper()
|
|||||||
|
|
||||||
static void InitializeProcess()
|
static void InitializeProcess()
|
||||||
{
|
{
|
||||||
for (auto& l_EventFD : l_EventFDs) {
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
l_Events[tid] = CreateEvent(nullptr, TRUE, FALSE, nullptr);
|
for (auto& event : l_Events) {
|
||||||
|
event = CreateEvent(nullptr, TRUE, FALSE, nullptr);
|
||||||
|
}
|
||||||
#else /* _WIN32 */
|
#else /* _WIN32 */
|
||||||
|
for (auto& eventFD : l_EventFDs) {
|
||||||
# ifdef HAVE_PIPE2
|
# ifdef HAVE_PIPE2
|
||||||
if (pipe2(l_EventFDs[tid], O_CLOEXEC) < 0) {
|
if (pipe2(eventFD, O_CLOEXEC) < 0) {
|
||||||
if (errno == ENOSYS) {
|
if (errno == ENOSYS) {
|
||||||
# endif /* HAVE_PIPE2 */
|
# endif /* HAVE_PIPE2 */
|
||||||
if (pipe(l_EventFD) < 0) {
|
if (pipe(eventFD) < 0) {
|
||||||
BOOST_THROW_EXCEPTION(posix_error()
|
BOOST_THROW_EXCEPTION(posix_error()
|
||||||
<< boost::errinfo_api_function("pipe")
|
<< boost::errinfo_api_function("pipe")
|
||||||
<< boost::errinfo_errno(errno));
|
<< boost::errinfo_errno(errno));
|
||||||
}
|
}
|
||||||
|
|
||||||
Utility::SetCloExec(l_EventFD[0]);
|
Utility::SetCloExec(eventFD[0]);
|
||||||
Utility::SetCloExec(l_EventFD[1]);
|
Utility::SetCloExec(eventFD[1]);
|
||||||
# ifdef HAVE_PIPE2
|
# ifdef HAVE_PIPE2
|
||||||
} else {
|
} else {
|
||||||
BOOST_THROW_EXCEPTION(posix_error()
|
BOOST_THROW_EXCEPTION(posix_error()
|
||||||
@ -530,8 +532,8 @@ static void InitializeProcess()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
# endif /* HAVE_PIPE2 */
|
# endif /* HAVE_PIPE2 */
|
||||||
#endif /* _WIN32 */
|
|
||||||
}
|
}
|
||||||
|
#endif /* _WIN32 */
|
||||||
}
|
}
|
||||||
|
|
||||||
INITIALIZE_ONCE(InitializeProcess);
|
INITIALIZE_ONCE(InitializeProcess);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user