Skip to contentSkip to conversation

libdaemon: do not print error if there is non

PATCH New Christian Hesse 1 participant 1 message Jul 11, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libdaemon: do not print error if there is non

From: Christian Hesse <[email protected]>

accept() returns EAGAIN if no connections are present to be accepted. That's not an error, so do not print error if there is non.

---
 libdaemon/server/daemon-server.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
libdaemon/server/daemon-server.c +2 -1
index 7911dd6..6de545e 100644
@@ -491,7 +491,8 @@ static int handle_connect(daemon_state s)
 
 	client.socket_fd = accept(s.socket_fd, (struct sockaddr *) &sockaddr, &sl);
 	if (client.socket_fd < 0) {
-		ERROR(&s, "Failed to accept connection.");
+		if (errno != EAGAIN && (EWOULDBLOCK != EAGAIN && errno != EWOULDBLOCK))
+			ERROR(&s, "Failed to accept connection.");
 		return 0;
 	}
 
Signature · 1 line
2.9.0