[icinga-checkins] icinga.org: icinga2/support/2.4: Fix crash on Windows

git at icinga.org git at icinga.org
Wed Aug 3 15:43:22 CEST 2016


Module: icinga2
Branch: support/2.4
Commit: f20ca06a522f6bdbb6a94054c148fddb1fed0672
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=f20ca06a522f6bdbb6a94054c148fddb1fed0672

Author: Gunnar Beutner <gunnar.beutner at netways.de>
Date:   Tue Jul 12 15:33:05 2016 +0200

Fix crash on Windows

fixes #11730

---

 lib/base/socketevents-poll.cpp |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/base/socketevents-poll.cpp b/lib/base/socketevents-poll.cpp
index 784212a..3532f56 100644
--- a/lib/base/socketevents-poll.cpp
+++ b/lib/base/socketevents-poll.cpp
@@ -55,6 +55,9 @@ void SocketEventEnginePoll::ThreadProc(int tid)
 				typedef std::map<SOCKET, SocketEventDescriptor>::value_type kv_pair;
 
 				BOOST_FOREACH(const kv_pair& desc, m_Sockets[tid]) {
+					if (desc.second.Events == 0)
+						continue;
+
 					if (desc.second.EventInterface)
 						desc.second.EventInterface->m_EnginePrivate = &pfds[i];
 
@@ -65,6 +68,8 @@ void SocketEventEnginePoll::ThreadProc(int tid)
 					i++;
 				}
 
+				pfds.resize(i);
+
 				m_FDChanged[tid] = false;
 				m_CV[tid].notify_all();
 			}



More information about the icinga-checkins mailing list