linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] [PATCH 1/1] libdaemon: do not print error if there is non
@ 2016-07-11 21:48 Christian Hesse
  0 siblings, 0 replies; only message in thread
From: Christian Hesse @ 2016-07-11 21:48 UTC (permalink / raw)
  To: LVM general discussion and development; +Cc: Christian Hesse

From: Christian Hesse <mail@eworm.de>

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.

Signed-off-by: Christian Hesse <mail@eworm.de>
---
 libdaemon/server/daemon-server.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libdaemon/server/daemon-server.c b/libdaemon/server/daemon-server.c
index 7911dd6..6de545e 100644
--- a/libdaemon/server/daemon-server.c
+++ b/libdaemon/server/daemon-server.c
@@ -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;
 	}
 
-- 
2.9.0

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-07-11 22:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-11 21:48 [linux-lvm] [PATCH 1/1] libdaemon: do not print error if there is non Christian Hesse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).