dovecot-1.0: Code cleanup
dovecot at dovecot.org
dovecot at dovecot.org
Sat Dec 1 10:39:20 EET 2007
details: http://hg.dovecot.org/dovecot-1.0/rev/cb48e59bd6b6
changeset: 5475:cb48e59bd6b6
user: Timo Sirainen <tss at iki.fi>
date: Sat Dec 01 10:31:05 2007 +0200
description:
Code cleanup
diffstat:
1 file changed, 4 insertions(+), 2 deletions(-)
src/lib-storage/index/maildir/maildir-util.c | 6 ++++--
diffs (30 lines):
diff -r 9f6b9a7e474c -r cb48e59bd6b6 src/lib-storage/index/maildir/maildir-util.c
--- a/src/lib-storage/index/maildir/maildir-util.c Sat Dec 01 10:29:12 2007 +0200
+++ b/src/lib-storage/index/maildir/maildir-util.c Sat Dec 01 10:31:05 2007 +0200
@@ -13,6 +13,8 @@
#include <fcntl.h>
#include <utime.h>
#include <sys/stat.h>
+
+#define MAILDIR_RESYNC_RETRY_COUNT 10
static int maildir_file_do_try(struct maildir_mailbox *mbox, uint32_t uid,
maildir_file_do_func *func, void *context)
@@ -65,7 +67,7 @@ int maildir_file_do(struct maildir_mailb
int i, ret;
ret = maildir_file_do_try(mbox, uid, func, context);
- for (i = 0; i < 10 && ret == 0; i++) {
+ for (i = 0; i < MAILDIR_RESYNC_RETRY_COUNT && ret == 0; i++) {
/* file is either renamed or deleted. sync the maildir and
see which one. if file appears to be renamed constantly,
don't try to open it more than 10 times. */
@@ -75,7 +77,7 @@ int maildir_file_do(struct maildir_mailb
ret = maildir_file_do_try(mbox, uid, func, context);
}
- if (i == 10)
+ if (i == MAILDIR_RESYNC_RETRY_COUNT)
ret = maildir_file_do_try(mbox, uid, do_racecheck, context);
return ret == -2 ? 0 : ret;
More information about the dovecot-cvs
mailing list