Description: Fix potential infinite stream of error messages during test.
Forwarded: git://storm-lang.org/storm.git/2e096272530ce3074c50b5e103968999323ec3df
Author: Filip Strömbäck <info@storm-lang.org>
--- a/Gui/App.cpp
+++ b/Gui/App.cpp
@@ -954,15 +954,22 @@
 	}
 
 	void AppWait::signal() {
+		if (headless)
+			return;
+
 		if (atomicCAS(signalSent, 0, 1) == 0) {
 			uint64_t val = 1;
-			while (true) {
+			bool retry = true;
+			while (retry) {
 				ssize_t r = write(pipeWrite, &val, 8);
-				if (r >= 0)
-					break;
-				if (errno == EAGAIN || errno == EINTR)
-					continue;
-				perror("Failed to signal eventfd/pipe");
+				if (r >= 0) {
+					retry = false;
+				} else if (errno == EAGAIN || errno == EINTR) {
+					retry = true;
+				} else {
+					perror("Failed to signal eventfd/pipe");
+					retry = false;
+				}
 			}
 		}
 	}
