From 9fae0d5cab19844a3311f915fce8b23209bcb695 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 2 Feb 1999 00:47:53 +0000 Subject: Fixed devide by zero on SIGHUP bug if no stat cache lookups have been done. Jeremy. --- source/smbd/filename.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/smbd/filename.c b/source/smbd/filename.c index 83e6fe092e1..134169ec2d9 100644 --- a/source/smbd/filename.c +++ b/source/smbd/filename.c @@ -96,7 +96,12 @@ static int global_stat_cache_hits; void print_stat_cache_statistics(void) { - double eff = (100.0* (double)global_stat_cache_hits)/(double)global_stat_cache_lookups; + double eff; + + if(global_stat_cache_lookups == 0) + return; + + eff = (100.0* (double)global_stat_cache_hits)/(double)global_stat_cache_lookups; DEBUG(0,("stat cache stats: lookups = %d, hits = %d, misses = %d, \ stat cache was %f%% effective.\n", global_stat_cache_lookups, -- cgit v1.2.1