[dovecot-cvs] dovecot/src/lib-index mail-cache-compress.c, 1.42, 1.42.2.1 mail-cache-private.h, 1.29.2.1, 1.29.2.2 mail-cache.c, 1.80.2.4, 1.80.2.5

tss at dovecot.org tss at dovecot.org
Fri Oct 13 16:32:34 UTC 2006


Update of /var/lib/cvs/dovecot/src/lib-index
In directory talvi:/tmp/cvs-serv18781/lib-index

Modified Files:
      Tag: branch_1_0
	mail-cache-compress.c mail-cache-private.h mail-cache.c 
Log Message:
Don't use time_t anymore in cache file. uint32_t is large enough and makes
cache files compatible between 32bit and 64bit systems.



Index: mail-cache-compress.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-cache-compress.c,v
retrieving revision 1.42
retrieving revision 1.42.2.1
diff -u -d -r1.42 -r1.42.2.1
--- mail-cache-compress.c	3 May 2006 20:07:13 -0000	1.42
+++ mail-cache-compress.c	13 Oct 2006 15:32:31 -0000	1.42.2.1
@@ -148,7 +148,6 @@
 	memset(&hdr, 0, sizeof(hdr));
 	hdr.version = MAIL_CACHE_VERSION;
 	hdr.compat_sizeof_uoff_t = sizeof(uoff_t);
-	hdr.compat_sizeof_time_t = sizeof(time_t);
 	hdr.indexid = idx_hdr->indexid;
 	hdr.file_seq = get_next_file_seq(cache, view);
 	o_stream_send(output, &hdr, sizeof(hdr));

Index: mail-cache-private.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-cache-private.h,v
retrieving revision 1.29.2.1
retrieving revision 1.29.2.2
diff -u -d -r1.29.2.1 -r1.29.2.2
--- mail-cache-private.h	13 Oct 2006 15:19:52 -0000	1.29.2.1
+++ mail-cache-private.h	13 Oct 2006 15:32:31 -0000	1.29.2.2
@@ -44,8 +44,7 @@
 	   compatibility. */
 	uint8_t version;
 	uint8_t compat_sizeof_uoff_t;
-	uint8_t compat_sizeof_time_t;
-	uint8_t unused;
+	uint8_t unused[2];
 
 	uint32_t indexid;
 	uint32_t file_seq;

Index: mail-cache.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-cache.c,v
retrieving revision 1.80.2.4
retrieving revision 1.80.2.5
diff -u -d -r1.80.2.4 -r1.80.2.5
--- mail-cache.c	13 Oct 2006 15:19:52 -0000	1.80.2.4
+++ mail-cache.c	13 Oct 2006 15:32:31 -0000	1.80.2.5
@@ -128,18 +128,9 @@
 		/* version changed - upgrade silently */
 		return FALSE;
 	}
-	if (hdr->compat_sizeof_uoff_t != sizeof(uoff_t) ||
-	    hdr->compat_sizeof_time_t != sizeof(time_t)) {
-		if (hdr->compat_sizeof_uoff_t == 0 &&
-		    hdr->compat_sizeof_time_t == 0) {
-			/* FIXME: keep backwards compatibility for a while.
-			   set hdr_modified=TRUE so header gets fixed the next
-			   time cache is locked. */
-			cache->hdr_modified = TRUE;
-		} else {
-			/* architecture change - handle silently(?) */
-			return FALSE;
-		}
+	if (hdr->compat_sizeof_uoff_t != sizeof(uoff_t)) {
+		/* architecture change - handle silently(?) */
+		return FALSE;
 	}
 
 	if (cache->hdr->indexid != cache->index->indexid) {
@@ -501,10 +492,6 @@
 	}
 
 	if (cache->hdr_modified) {
-		/* FIXME: for backwards compatibility - keep them for a while */
-		cache->hdr_copy.compat_sizeof_uoff_t = sizeof(uoff_t);
-		cache->hdr_copy.compat_sizeof_time_t = sizeof(time_t);
-
 		cache->hdr_modified = FALSE;
 		if (mail_cache_write(cache, &cache->hdr_copy,
 				     sizeof(cache->hdr_copy), 0) < 0)



More information about the dovecot-cvs mailing list