]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Don't send \Unmarked in LIST reply unless mbox file is zero-sized. We can't
authorTimo Sirainen <tss@iki.fi>
Thu, 26 Jun 2003 00:48:31 +0000 (03:48 +0300)
committerTimo Sirainen <tss@iki.fi>
Thu, 26 Jun 2003 00:48:31 +0000 (03:48 +0300)
get it right with atime checks, so don't even try.

--HG--
branch : HEAD

src/lib-storage/index/mbox/mbox-list.c

index 0e88bbcb97eb510944e98a332ccec4371758c7a2..93fa55d3f1005010e9c6a211cec6987dedcb2483 100644 (file)
 #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;