dovecot-2.2: replication plugin: Fixed handling EAGAIN errors wh...

dovecot at dovecot.org dovecot at dovecot.org
Fri May 15 10:57:54 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/d46270397a2f
changeset: 18701:d46270397a2f
user:      Timo Sirainen <tss at iki.fi>
date:      Fri May 15 13:55:46 2015 +0300
description:
replication plugin: Fixed handling EAGAIN errors when writing to replication-pipe.

diffstat:

 src/plugins/replication/replication-plugin.c |  12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (26 lines):

diff -r 7cf62f28fd62 -r d46270397a2f src/plugins/replication/replication-plugin.c
--- a/src/plugins/replication/replication-plugin.c	Fri May 15 13:54:49 2015 +0300
+++ b/src/plugins/replication/replication-plugin.c	Fri May 15 13:55:46 2015 +0300
@@ -80,16 +80,16 @@
 	}
 	str_append_c(str, '\n');
 	ret = write(fifo_fd, str_data(str), str_len(str));
-	if (ret == 0) {
-		/* busy, try again later */
-		return 0;
-	}
+	i_assert(ret != 0);
 	if (ret != (ssize_t)str_len(str)) {
 		if (ret > 0)
 			i_error("write(%s) wrote partial data", fifo_path);
-		else if (errno != EPIPE)
+		else if (errno == EAGAIN) {
+			/* busy, try again later */
+			return 0;
+		} else if (errno != EPIPE) {
 			i_error("write(%s) failed: %m", fifo_path);
-		else {
+		} else {
 			/* server was probably restarted, don't bother logging
 			   this. */
 		}


More information about the dovecot-cvs mailing list