changeset 6022:8da2881df0dc HEAD

mail_index_move_to_memory(): Don't log an error if index fd is already closed
author Timo Sirainen <tss@iki.fi>
date Sun, 15 Jul 2007 15:27:58 +0300
parents f40d16eed722
children 56879cc53cec
files src/lib-index/mail-index.c
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-index/mail-index.c	Sun Jul 15 14:44:23 2007 +0300
+++ b/src/lib-index/mail-index.c	Sun Jul 15 15:27:58 2007 +0300
@@ -665,10 +665,11 @@
 	if (index->file_lock != NULL)
 		file_lock_free(&index->file_lock);
 
-	/* close the index file. */
-	if (close(index->fd) < 0)
-		mail_index_set_syscall_error(index, "close()");
-	index->fd = -1;
+	if (index->fd != -1) {
+		if (close(index->fd) < 0)
+			mail_index_set_syscall_error(index, "close()");
+		index->fd = -1;
+	}
 	return 0;
 }