changeset 14269:9d47be37afeb

replication plugin: Don't try to close fifo if it wasn't even opened.
author Timo Sirainen <tss@iki.fi>
date Sun, 04 Mar 2012 11:23:14 +0200
parents a422bd8ed511
children 633e587446d8
files src/plugins/replication/replication-plugin.c
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/replication/replication-plugin.c	Sun Mar 04 11:19:10 2012 +0200
+++ b/src/plugins/replication/replication-plugin.c	Sun Mar 04 11:23:14 2012 +0200
@@ -357,9 +357,11 @@
 
 void replication_plugin_deinit(void)
 {
-	if (close(fifo_fd) < 0)
-		i_error("close(%s) failed: %m", fifo_path);
-	fifo_fd = -1;
+	if (fifo_fd != -1) {
+		if (close(fifo_fd) < 0)
+			i_error("close(%s) failed: %m", fifo_path);
+		fifo_fd = -1;
+	}
 	i_free_and_null(fifo_path);
 
 	mail_storage_hooks_remove(&replication_mail_storage_hooks);