diff src/lib-storage/index/maildir/maildir-mail.c @ 4672:b7ff8c64c436 HEAD

We added received date as time_t instead of uint32_t which crashed with 64bit systems.
author Timo Sirainen <tss@iki.fi>
date Sun, 15 Oct 2006 13:36:27 +0300
parents ce727f4e53e5
children 5587c9345e39
line wrap: on
line diff
--- a/src/lib-storage/index/maildir/maildir-mail.c	Sat Oct 14 02:52:02 2006 +0300
+++ b/src/lib-storage/index/maildir/maildir-mail.c	Sun Oct 15 13:36:27 2006 +0300
@@ -78,6 +78,7 @@
 	struct maildir_mailbox *mbox = (struct maildir_mailbox *)mail->box;
 	struct index_mail_data *data = &((struct index_mail *)mail)->data;
 	const char *path;
+	uint32_t t;
 	int fd;
 
 	if (data->access_part != 0 && data->stream == NULL) {
@@ -118,9 +119,8 @@
 	if (maildir_mail_stat(_mail, &st) < 0)
 		return (time_t)-1;
 
-	data->received_date = st.st_mtime;
-	index_mail_cache_add(mail, MAIL_CACHE_RECEIVED_DATE,
-			     &data->received_date, sizeof(data->received_date));
+	data->received_date = t = st.st_mtime;
+	index_mail_cache_add(mail, MAIL_CACHE_RECEIVED_DATE, &t, sizeof(t));
 	return data->received_date;
 }