From 8a5e1423ca0c05c2fa4e499aba6244b34f4700ba Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Tue, 8 May 2012 09:44:58 +0200 Subject: [PATCH] Bugfix: Deal with error code for bind() --- base/tcpsocket.cpp | 8 ++++++-- icinga-app/icinga3.conf | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/base/tcpsocket.cpp b/base/tcpsocket.cpp index 9f08ae2f0..e6bfe5d70 100644 --- a/base/tcpsocket.cpp +++ b/base/tcpsocket.cpp @@ -60,11 +60,15 @@ void TCPSocket::Bind(string node, string service, int family) int rc = ::bind(fd, info->ai_addr, info->ai_addrlen); #ifdef _WIN32 - if (rc < 0 && WSAGetLastError() != WSAEWOULDBLOCK) + if (rc < 0 && WSAGetLastError() != WSAEWOULDBLOCK) { #else /* _WIN32 */ - if (rc < 0 && errno != EINPROGRESS) + if (rc < 0 && errno != EINPROGRESS) { #endif /* _WIN32 */ + closesocket(fd); + SetFD(INVALID_SOCKET); + continue; + } break; } diff --git a/icinga-app/icinga3.conf b/icinga-app/icinga3.conf index ceb61f084..c72f195a9 100644 --- a/icinga-app/icinga3.conf +++ b/icinga-app/icinga3.conf @@ -5,7 +5,7 @@ "pubkey": "icinga-c3.crt", "cakey": "ca.crt", "node": "10.0.10.14", - "service": "8888" + "service": "9999" } }, "component": { @@ -14,7 +14,7 @@ "discovery": { "replicate": "0", "broker": "0" } }, "rpclistener": { - "kekslistener": { "replicate": "0", "service": "8888" } + "kekslistener": { "replicate": "0", "service": "9999" } }, "broker": { "icinga-c1": { "replicate": "0", "node": "10.0.10.3", "service": "7777" }