changeset 17062:3535659d6cc2

lib-master: Show better error message when process_limit is reached.
author Timo Sirainen <tss@iki.fi>
date Thu, 12 Dec 2013 18:21:49 +0200
parents 1600e97dabbb
children 89f1cefe0f89
files src/lib-master/master-auth.c
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-master/master-auth.c	Thu Dec 12 18:08:25 2013 +0200
+++ b/src/lib-master/master-auth.c	Thu Dec 12 18:21:49 2013 +0200
@@ -108,14 +108,14 @@
 	ret = read(conn->fd, conn->buf + conn->buf_pos,
 		   sizeof(conn->buf) - conn->buf_pos);
 	if (ret <= 0) {
-		if (ret < 0) {
+		if (ret == 0 || errno == ECONNRESET) {
+			i_error("read(%s) failed: Remote closed connection "
+				"(service's process_limit reached?)",
+				conn->auth->path, conn->auth->path);
+		} else {
 			if (errno == EAGAIN)
 				return;
 			i_error("read(%s) failed: %m", conn->auth->path);
-		} else {
-			i_error("read(%s) failed: Remote closed connection "
-				"(process_limit reached?)",
-				conn->auth->path);
 		}
 		master_auth_connection_deinit(&conn);
 		return;