diff options
author | Jeremy Allison <jra@samba.org> | 1999-02-02 00:47:53 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 1999-02-02 00:47:53 +0000 |
commit | 9fae0d5cab19844a3311f915fce8b23209bcb695 (patch) | |
tree | 51761e37a43bb272dcad357f96e10075cd8b8dac | |
parent | 72e5c7c510553e50ec1f0c970e679c8f6cf4903a (diff) | |
download | samba-9fae0d5cab19844a3311f915fce8b23209bcb695.tar.gz |
Fixed devide by zero on SIGHUP bug if no stat cache lookups
have been done.
Jeremy.
-rw-r--r-- | source/smbd/filename.c | 7 |
1 files changed, 6 insertions, 1 deletions
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, |