From edebc8d07b83db3ccbbdf9898817ec1699d2631d Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Mon, 18 Jul 2011 09:05:56 +0300 Subject: [PATCH] * log index, cleanup separately, less confusing + cosmetic --- src/mu-cmd-index.c | 19 ++++++++++--------- src/mu-index.c | 9 ++++----- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/mu-cmd-index.c b/src/mu-cmd-index.c index cad0be5c..2242f67c 100644 --- a/src/mu-cmd-index.c +++ b/src/mu-cmd-index.c @@ -318,21 +318,22 @@ cmd_index (MuIndex *midx, MuConfig *opts, MuIndexStats *stats, g_print ("\n"); show_time ((unsigned)(time(NULL)-t),stats->_processed); } + + if (rv == MU_OK || rv == MU_STOP) + MU_WRITE_LOG ("index: processed: %u; updated/new: %u", + stats->_processed, stats->_updated); if (rv == MU_OK && !opts->nocleanup) { mu_index_stats_clear (stats); rv = cmd_cleanup (midx, opts, stats, show_progress); + if (rv == MU_OK) { + MU_WRITE_LOG ("cleanup: processed: %u; cleaned-up: %u", + stats->_processed, stats->_cleaned_up); + return MU_EXITCODE_OK; + } } - if (rv == MU_OK || rv == MU_STOP) { - MU_WRITE_LOG ("processed: %u; updated/new: %u, " - "cleaned-up: %u", - stats->_processed, stats->_updated, - stats->_cleaned_up); - return MU_EXITCODE_OK; - } - - return MU_EXITCODE_ERROR; + return (rv==MU_OK||rv==MU_STOP) ? MU_EXITCODE_OK : MU_EXITCODE_ERROR; } static MuExitCode diff --git a/src/mu-index.c b/src/mu-index.c index 8cef66e2..0d3fffc6 100644 --- a/src/mu-index.c +++ b/src/mu-index.c @@ -105,11 +105,10 @@ struct _MuIndexCallbackData { typedef struct _MuIndexCallbackData MuIndexCallbackData; -/* checks to determine if we need to (re)index this message - * note: just check timestamps is not good enough because - * message may be moved from other dirs (e.g. from 'new' to - * 'cur') and the time stamps won't change. - * */ +/* checks to determine if we need to (re)index this message note: + * simply checking timestamps is not good enough because message may + * be moved from other dirs (e.g. from 'new' to 'cur') and the time + * stamps won't change. */ static inline gboolean needs_index (MuIndexCallbackData *data, const char *fullpath, time_t filestamp)