# HG changeset patch # User Timo Sirainen # Date 1265116804 -7200 # Node ID 568c437ad9517aa477b513106fd51cd23bf101f6 # Parent 5e50d5597474f62b415b5af24ad202a92461fdd4 expire-tool: Check and log an error if dict iteration fails. diff -r 5e50d5597474 -r 568c437ad951 src/plugins/expire/expire-tool.c --- a/src/plugins/expire/expire-tool.c Tue Feb 02 15:18:25 2010 +0200 +++ b/src/plugins/expire/expire-tool.c Tue Feb 02 15:20:04 2010 +0200 @@ -230,7 +230,7 @@ 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 @@ 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 @@ } T_END; } } + if (ret < 0) + i_error("Dictionary iteration failed"); if (testrun && userp == NULL) i_info("No entries in dictionary");