From: Timo Sirainen Date: Tue, 2 Feb 2010 13:20:04 +0000 (+0200) Subject: expire-tool: Check and log an error if dict iteration fails. X-Git-Tag: 2.0.beta3~170 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cd7d3a9e42a9dfc66f79f21d59ef836f2f0cbb8f;p=thirdparty%2Fdovecot%2Fcore.git expire-tool: Check and log an error if dict iteration fails. --HG-- branch : HEAD --- diff --git a/src/plugins/expire/expire-tool.c b/src/plugins/expire/expire-tool.c index dd6f542118..9636a0bd99 100644 --- a/src/plugins/expire/expire-tool.c +++ b/src/plugins/expire/expire-tool.c @@ -230,7 +230,7 @@ static void expire_run(struct master_service *service, bool testrun) DICT_ITERATE_FLAG_SORT_BY_VALUE); /* We'll get the oldest values (timestamps) first */ - while (dict_iterate(iter, &key, &value) > 0) { + while ((ret = dict_iterate(iter, &key, &value)) > 0) { /* key = DICT_EXPIRE_PREFIX/ */ userp = key + strlen(DICT_EXPIRE_PREFIX); @@ -263,6 +263,7 @@ static void expire_run(struct master_service *service, bool testrun) if (ret < 0) { /* failed to update */ + ret = 0; } else if (next_expire == 0) { /* no more messages or mailbox deleted */ if (!testrun) @@ -287,6 +288,8 @@ static void expire_run(struct master_service *service, bool testrun) } T_END; } } + if (ret < 0) + i_error("Dictionary iteration failed"); if (testrun && userp == NULL) i_info("No entries in dictionary");