From: Timo Sirainen Date: Fri, 15 May 2015 10:55:46 +0000 (+0300) Subject: replication plugin: Fixed handling EAGAIN errors when writing to replication-pipe. X-Git-Tag: 2.2.18~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cf5533e38e40da0b9046c8ca09b96fedf0387e99;p=thirdparty%2Fdovecot%2Fcore.git replication plugin: Fixed handling EAGAIN errors when writing to replication-pipe. --- diff --git a/src/plugins/replication/replication-plugin.c b/src/plugins/replication/replication-plugin.c index 4f11ed5216..921f91eea8 100644 --- a/src/plugins/replication/replication-plugin.c +++ b/src/plugins/replication/replication-plugin.c @@ -80,16 +80,16 @@ replication_fifo_notify(struct mail_user *user, } 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. */ }