[dovecot-cvs] dovecot/src/lib-index mail-index-compress.c,1.16,1.17

cras at procontrol.fi cras at procontrol.fi
Thu Oct 24 05:48:00 EEST 2002


Update of /home/cvs/dovecot/src/lib-index
In directory danu:/tmp/cvs-serv30455

Modified Files:
	mail-index-compress.c 
Log Message:
Make sure we never truncate ourself smaller than INDEX_FILE_MIN_SIZE.



Index: mail-index-compress.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-index/mail-index-compress.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- mail-index-compress.c	23 Oct 2002 19:49:23 -0000	1.16
+++ mail-index-compress.c	24 Oct 2002 01:47:58 -0000	1.17
@@ -33,6 +33,9 @@
 			(index->mmap_full_length - sizeof(MailIndexHeader)) %
 			sizeof(MailIndexRecord);
 
+		if (index->mmap_full_length < INDEX_FILE_MIN_SIZE)
+                        index->mmap_full_length = INDEX_FILE_MIN_SIZE;
+
 		if (ftruncate(index->fd, (off_t)index->mmap_full_length) < 0)
 			return index_set_syscall_error(index, "ftruncate()");
 




More information about the dovecot-cvs mailing list