[dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-list.c,1.19,1.20

cras at procontrol.fi cras at procontrol.fi
Thu Jun 26 04:48:34 EEST 2003


Update of /home/cvs/dovecot/src/lib-storage/index/mbox
In directory danu:/tmp/cvs-serv19612/lib-storage/index/mbox

Modified Files:
	mbox-list.c 
Log Message:
Don't send \Unmarked in LIST reply unless mbox file is zero-sized. We can't
get it right with atime checks, so don't even try.



Index: mbox-list.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/mbox/mbox-list.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- mbox-list.c	18 May 2003 16:02:46 -0000	1.19
+++ mbox-list.c	26 Jun 2003 00:48:31 -0000	1.20
@@ -11,9 +11,13 @@
 #include <dirent.h>
 #include <sys/stat.h>
 
+/* atime < mtime is a reliable way to know that something changed in the file.
+   atime >= mtime is not however reliable, especially because atime gets
+   updated whenever we open the mbox file, and STATUS/EXAMINE shouldn't change
+   \Marked mailbox to \Unmarked.. */
 #define STAT_GET_MARKED(st) \
-	((st).st_size != 0 && (st).st_atime < (st).st_ctime ? \
-	 MAILBOX_MARKED : MAILBOX_UNMARKED)
+	((st).st_size == 0 ? MAILBOX_UNMARKED : \
+	 (st).st_atime < (st).st_mtime ? MAILBOX_MARKED : 0)
 
 struct list_dir_context {
 	struct list_dir_context *prev;



More information about the dovecot-cvs mailing list