]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
replication plugin: Fixed handling EAGAIN errors when writing to replication-pipe.
authorTimo Sirainen <tss@iki.fi>
Fri, 15 May 2015 10:55:46 +0000 (13:55 +0300)
committerTimo Sirainen <tss@iki.fi>
Fri, 15 May 2015 10:55:46 +0000 (13:55 +0300)
src/plugins/replication/replication-plugin.c

index 4f11ed521601a550ccca66d7eff17efd81cc55ef..921f91eea8690522a343ed1d6a497371686b36f2 100644 (file)
@@ -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. */
                }