From: Timo Sirainen Date: Mon, 26 Sep 2011 21:44:03 +0000 (+0300) Subject: stats: Compiler warning fixes. X-Git-Tag: 2.1.beta1~120 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=132bd0d1d5b2ffa78cf4f71c1df1ff40dd28f086;p=thirdparty%2Fdovecot%2Fcore.git stats: Compiler warning fixes. --- diff --git a/src/stats/mail-command.c b/src/stats/mail-command.c index 440b50586c..ead8b90ea0 100644 --- a/src/stats/mail-command.c +++ b/src/stats/mail-command.c @@ -153,6 +153,8 @@ int mail_command_update_parse(const char *const *args, const char **error_r) void mail_commands_free_memory(void) { + unsigned int diff; + while (stable_mail_commands != NULL) { struct mail_command *cmd = stable_mail_commands; @@ -168,8 +170,9 @@ void mail_commands_free_memory(void) if (global_used_memory < stats_settings->memory_limit) break; - if (ioloop_time - - stable_mail_commands->last_update.tv_sec < stats_settings->command_min_time) + + diff = ioloop_time - stable_mail_commands->last_update.tv_sec; + if (diff < stats_settings->command_min_time) break; } } diff --git a/src/stats/mail-domain.c b/src/stats/mail-domain.c index 49b5350b28..24e2c352f7 100644 --- a/src/stats/mail-domain.c +++ b/src/stats/mail-domain.c @@ -95,13 +95,16 @@ void mail_domain_refresh(struct mail_domain *domain, void mail_domains_free_memory(void) { + unsigned int diff; + while (mail_domains_head != NULL && mail_domains_head->refcount == 0) { mail_domain_free(mail_domains_head); if (global_used_memory < stats_settings->memory_limit) break; - if (ioloop_time - - mail_domains_head->last_update.tv_sec < stats_settings->domain_min_time) + + diff = ioloop_time - mail_domains_head->last_update.tv_sec; + if (diff < stats_settings->domain_min_time) break; } } diff --git a/src/stats/mail-ip.c b/src/stats/mail-ip.c index 4227fb6b8d..69fc58fffd 100644 --- a/src/stats/mail-ip.c +++ b/src/stats/mail-ip.c @@ -91,13 +91,16 @@ void mail_ip_refresh(struct mail_ip *ip, const struct mail_stats *diff_stats) void mail_ips_free_memory(void) { + unsigned int diff; + while (mail_ips_head != NULL && mail_ips_head->refcount == 0) { mail_ip_free(mail_ips_head); if (global_used_memory < stats_settings->memory_limit) break; - if (ioloop_time - - mail_ips_head->last_update.tv_sec < stats_settings->ip_min_time) + + diff = ioloop_time - mail_ips_head->last_update.tv_sec; + if (diff < stats_settings->ip_min_time) break; } } diff --git a/src/stats/mail-session.c b/src/stats/mail-session.c index d8251e07a9..790396d5f5 100644 --- a/src/stats/mail-session.c +++ b/src/stats/mail-session.c @@ -246,6 +246,8 @@ int mail_session_update_parse(const char *const *args, const char **error_r) void mail_sessions_free_memory(void) { + unsigned int diff; + while (mail_sessions_head != NULL && mail_sessions_head->refcount == 0) { i_assert(mail_sessions_head->disconnected); @@ -253,8 +255,9 @@ void mail_sessions_free_memory(void) if (global_used_memory < stats_settings->memory_limit) break; - if (ioloop_time - - mail_sessions_head->last_update.tv_sec < stats_settings->session_min_time) + + diff = ioloop_time - mail_sessions_head->last_update.tv_sec; + if (diff < stats_settings->session_min_time) break; } } diff --git a/src/stats/mail-user.c b/src/stats/mail-user.c index 299844f73f..5f833e516c 100644 --- a/src/stats/mail-user.c +++ b/src/stats/mail-user.c @@ -112,13 +112,16 @@ void mail_user_refresh(struct mail_user *user, void mail_users_free_memory(void) { + unsigned int diff; + while (mail_users_head != NULL && mail_users_head->refcount == 0) { mail_user_free(mail_users_head); if (global_used_memory < stats_settings->memory_limit) break; - if (ioloop_time - - mail_users_head->last_update.tv_sec < stats_settings->user_min_time) + + diff = ioloop_time - mail_users_head->last_update.tv_sec; + if (diff < stats_settings->user_min_time) break; } }