[icinga-checkins] icinga.org: icinga2/master: Fixed exception in command pipe thread after sending Icinga SIGTERM.

git at icinga.org git at icinga.org
Sun Feb 10 12:45:48 CET 2013


Module: icinga2
Branch: master
Commit: dd93206113c14a7c601b1ca8443b34e20fe1ce65
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=dd93206113c14a7c601b1ca8443b34e20fe1ce65

Author: Gunnar Beutner <gunnar.beutner at netways.de>
Date:   Sun Feb 10 12:28:27 2013 +0100

Fixed exception in command pipe thread after sending Icinga SIGTERM.

---

 components/compat/compatcomponent.cpp |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/components/compat/compatcomponent.cpp b/components/compat/compatcomponent.cpp
index 1aef5b0..48c2207 100644
--- a/components/compat/compatcomponent.cpp
+++ b/components/compat/compatcomponent.cpp
@@ -129,7 +129,11 @@ void CompatComponent::CommandPipeThread(const String& commandPath)
 		BOOST_THROW_EXCEPTION(PosixException("mkfifo() failed", errno));
 
 	for (;;) {
-		int fd = open(commandPath.CStr(), O_RDONLY);
+		int fd;
+
+		do {
+			fd = open(commandPath.CStr(), O_RDONLY);
+		} while (fd < 0 && errno == EINTR);
 
 		if (fd < 0)
 			BOOST_THROW_EXCEPTION(PosixException("open() failed", errno));





More information about the icinga-checkins mailing list