changeset 226:a3fa2d4f441c HEAD

creating data file didn't work
author Timo Sirainen <tss@iki.fi>
date Sun, 15 Sep 2002 09:48:54 +0300
parents c02b968d0378
children 2499dad2932b
files src/lib-index/mail-index-data.c
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-index/mail-index-data.c	Sun Sep 15 09:31:47 2002 +0300
+++ b/src/lib-index/mail-index-data.c	Sun Sep 15 09:48:54 2002 +0300
@@ -242,7 +242,7 @@
 		fd = -1;
 	} else {
 		fd = mail_index_create_temp_file(index, &temppath);
-		if (fd != -1) {
+		if (fd == -1) {
 			if (errno == ENOSPC)
 				index->nodiskspace = TRUE;
 			return FALSE;
@@ -275,6 +275,11 @@
 	data->index = index;
 	data->fd = fd;
 
+	if (!mmap_update(data, 0, sizeof(MailIndexDataHeader))) {
+		mail_index_data_free(data);
+		return FALSE;
+	}
+
 	index->data = data;
 	return TRUE;
 }