]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
expire-tool: Check and log an error if dict iteration fails.
authorTimo Sirainen <tss@iki.fi>
Tue, 2 Feb 2010 13:20:04 +0000 (15:20 +0200)
committerTimo Sirainen <tss@iki.fi>
Tue, 2 Feb 2010 13:20:04 +0000 (15:20 +0200)
--HG--
branch : HEAD

src/plugins/expire/expire-tool.c

index dd6f542118d5cffb25a3e68732860031bffa67ef..9636a0bd998888d794b2033eabd6f866ec957f39 100644 (file)
@@ -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<user>/<mailbox> */
                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");