dovecot-2.2: replicator plugin: Use non-blocking open for the re...

dovecot at dovecot.org dovecot at dovecot.org
Thu Jan 31 22:14:29 EET 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/0a5a19067d95
changeset: 15705:0a5a19067d95
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Jan 31 22:13:36 2013 +0200
description:
replicator plugin: Use non-blocking open for the replicator fifo.
This fixes an infinite hang if the replicator process isn't running.

diffstat:

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

diffs (18 lines):

diff -r 138f1c76c0ec -r 0a5a19067d95 src/plugins/replication/replication-plugin.c
--- a/src/plugins/replication/replication-plugin.c	Thu Jan 31 21:49:00 2013 +0200
+++ b/src/plugins/replication/replication-plugin.c	Thu Jan 31 22:13:36 2013 +0200
@@ -56,13 +56,12 @@
 	if (fifo_failed)
 		return -1;
 	if (fifo_fd == -1) {
-		fifo_fd = open(fifo_path, O_WRONLY);
+		fifo_fd = open(fifo_path, O_WRONLY | O_NONBLOCK);
 		if (fifo_fd == -1) {
 			i_error("open(%s) failed: %m", fifo_path);
 			fifo_failed = TRUE;
 			return -1;
 		}
-		fd_set_nonblock(fifo_fd, TRUE);
 	}
 	/* <username> \t <priority> */
 	str = t_str_new(256);


More information about the dovecot-cvs mailing list