dovecot-2.2: lib-index: Support clearing the whole log view with...

dovecot at dovecot.org dovecot at dovecot.org
Mon Aug 13 00:33:58 EEST 2012


details:   http://hg.dovecot.org/dovecot-2.2/rev/7aece00b8538
changeset: 14884:7aece00b8538
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Aug 13 00:33:47 2012 +0300
description:
lib-index: Support clearing the whole log view with mail_transaction_log_view_clear(0)

diffstat:

 src/lib-index/mail-transaction-log-view.c |  3 ++-
 src/lib-index/mail-transaction-log.h      |  4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 222c7d752519 -r 7aece00b8538 src/lib-index/mail-transaction-log-view.c
--- a/src/lib-index/mail-transaction-log-view.c	Mon Aug 13 00:31:40 2012 +0300
+++ b/src/lib-index/mail-transaction-log-view.c	Mon Aug 13 00:33:47 2012 +0300
@@ -330,7 +330,8 @@
 	struct mail_transaction_log_file *file;
 
 	mail_transaction_log_view_unref_all(view);
-	if (mail_transaction_log_find_file(view->log, oldest_file_seq, FALSE,
+	if (oldest_file_seq != 0 &&
+	    mail_transaction_log_find_file(view->log, oldest_file_seq, FALSE,
 					   &file) > 0) {
 		for (; file != NULL; file = file->next) {
 			array_append(&view->file_refs, &file, 1);
diff -r 222c7d752519 -r 7aece00b8538 src/lib-index/mail-transaction-log.h
--- a/src/lib-index/mail-transaction-log.h	Mon Aug 13 00:31:40 2012 +0300
+++ b/src/lib-index/mail-transaction-log.h	Mon Aug 13 00:33:47 2012 +0300
@@ -225,8 +225,8 @@
 /* Scan through all of the log files that we can find.
    Returns -1 if error, 0 if ok. */
 int mail_transaction_log_view_set_all(struct mail_transaction_log_view *view);
-/* Clear the view. Keep oldest_file_seq and newer log files referenced so we
-   don't get desynced. */
+/* Clear the view. If oldest_file_seq > 0, keep it and newer log files
+   referenced so we don't get desynced. */
 void mail_transaction_log_view_clear(struct mail_transaction_log_view *view,
 				     uint32_t oldest_file_seq);
 


More information about the dovecot-cvs mailing list