[dovecot-cvs] dovecot/src/auth auth-cache.c,1.12,1.13
cras at dovecot.org
cras at dovecot.org
Fri Oct 7 13:23:04 EEST 2005
Update of /var/lib/cvs/dovecot/src/auth
In directory talvi:/tmp/cvs-serv5567
Modified Files:
auth-cache.c
Log Message:
Don't crash with SIGUSR2 if auth cache hasn't seen any hits
Index: auth-cache.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/auth-cache.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- auth-cache.c 25 Sep 2005 11:07:32 -0000 1.12
+++ auth-cache.c 7 Oct 2005 10:23:01 -0000 1.13
@@ -112,7 +112,7 @@
total_count = cache->hit_count + cache->miss_count;
i_info("Authentication cache hits %u/%u (%u%%)",
cache->hit_count, total_count,
- cache->hit_count * 100 / total_count);
+ total_count == 0 ? 100 : (cache->hit_count * 100 / total_count));
/* reset hit counter */
cache->hit_count = cache->miss_count = 0;
More information about the dovecot-cvs
mailing list