dovecot-2.0: sdbox: Added more error message logging.

dovecot at dovecot.org dovecot at dovecot.org
Tue Apr 5 22:43:59 EEST 2011


details:   http://hg.dovecot.org/dovecot-2.0/rev/654b5a2fc926
changeset: 12718:654b5a2fc926
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Apr 05 22:43:54 2011 +0300
description:
sdbox: Added more error message logging.

diffstat:

 src/lib-storage/index/dbox-single/sdbox-sync-rebuild.c |  14 +++++++++++---
 src/lib-storage/index/dbox-single/sdbox-sync.c         |   3 +++
 2 files changed, 14 insertions(+), 3 deletions(-)

diffs (38 lines):

diff -r 699d181a5578 -r 654b5a2fc926 src/lib-storage/index/dbox-single/sdbox-sync-rebuild.c
--- a/src/lib-storage/index/dbox-single/sdbox-sync-rebuild.c	Tue Apr 05 19:08:31 2011 +0300
+++ b/src/lib-storage/index/dbox-single/sdbox-sync-rebuild.c	Tue Apr 05 22:43:54 2011 +0300
@@ -153,10 +153,18 @@
 					 MAILBOX_LIST_PATH_TYPE_ALT_MAILBOX);
 
 	sdbox_sync_set_uidvalidity(ctx);
-	if (sdbox_sync_index_rebuild_dir(ctx, ctx->box->path, TRUE) < 0)
+	if (sdbox_sync_index_rebuild_dir(ctx, ctx->box->path, TRUE) < 0) {
+		mail_storage_set_critical(ctx->box->storage,
+			"sdbox: Rebuilding failed on path %s", ctx->box->path);
 		ret = -1;
-	else if (alt_path != NULL)
-		ret = sdbox_sync_index_rebuild_dir(ctx, alt_path, FALSE);
+	} else if (alt_path != NULL) {
+		if (sdbox_sync_index_rebuild_dir(ctx, alt_path, FALSE) < 0) {
+			mail_storage_set_critical(ctx->box->storage,
+				"sdbox: Rebuilding failed on alt path %s",
+				alt_path);
+			ret = -1;
+		}
+	}
 	sdbox_sync_update_header(ctx);
 	return ret;
 }
diff -r 699d181a5578 -r 654b5a2fc926 src/lib-storage/index/dbox-single/sdbox-sync.c
--- a/src/lib-storage/index/dbox-single/sdbox-sync.c	Tue Apr 05 19:08:31 2011 +0300
+++ b/src/lib-storage/index/dbox-single/sdbox-sync.c	Tue Apr 05 22:43:54 2011 +0300
@@ -115,6 +115,9 @@
 	hdr = mail_index_get_header(ctx->sync_view);
 	if (hdr->uid_validity == 0) {
 		/* newly created index file */
+		mail_storage_set_critical(box->storage,
+			"sdbox %s: Broken index: missing UIDVALIDITY",
+			box->path);
 		return 0;
 	}
 


More information about the dovecot-cvs mailing list