]> granicus.if.org Git - icinga2/commitdiff
Fixed exception in command pipe thread after sending Icinga SIGTERM.
authorGunnar Beutner <gunnar.beutner@netways.de>
Sun, 10 Feb 2013 11:28:27 +0000 (12:28 +0100)
committerGunnar Beutner <gunnar.beutner@netways.de>
Sun, 10 Feb 2013 11:42:14 +0000 (12:42 +0100)
components/compat/compatcomponent.cpp

index 1aef5b0fb807fc65da9c174282a9e09cfc738f38..48c2207a623a13d594f831d62df666d77eb91b72 100644 (file)
@@ -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));