From: Gunnar Beutner Date: Sun, 24 Jun 2012 14:36:46 +0000 (+0200) Subject: More fixes. X-Git-Tag: v0.0.1~365 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1cffed4b430855d4fe7bf0cef0d729a176067cfc;p=icinga2 More fixes. --- diff --git a/icinga/nagioschecktask.cpp b/icinga/nagioschecktask.cpp index 97fb58677..ceb0fdcf7 100644 --- a/icinga/nagioschecktask.cpp +++ b/icinga/nagioschecktask.cpp @@ -77,7 +77,9 @@ void NagiosCheckTask::CheckThreadProc(void) if (!it->second->RunTask()) { CheckTask::FinishTask(it->second); - it = tasks.erase(it); + prev = it; + it++; + tasks.erase(prev); } else { it++; } @@ -138,7 +140,7 @@ bool NagiosCheckTask::RunTask(void) status = _pclose(m_FP); #else /* _MSC_VER */ if (m_UsePopen) - status = pclose(fp); + status = pclose(m_FP); else status = pclose_noshell(&m_PCloseArg); #endif /* _MSC_VER */ diff --git a/icinga/nagioschecktask.h b/icinga/nagioschecktask.h index ef46d079f..ee4ca9fcc 100644 --- a/icinga/nagioschecktask.h +++ b/icinga/nagioschecktask.h @@ -27,7 +27,9 @@ private: FILE *m_FP; stringstream m_OutputStream; bool m_UsePopen; +#ifndef _MSC_VER popen_noshell_pass_to_pclose m_PCloseArg; +#endif /* _MSC_VER */ static boost::mutex m_Mutex; static deque m_Tasks;