From: Jim Rees Date: Fri, 16 Jun 2006 20:08:29 +0000 (+0000) Subject: no-divide-by-zero-20060616 X-Git-Tag: BP-openafs-windows-kdfs-ifs~1266 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=1833072cc857fd0ee217f81e5be27f9f023cf9a1;p=packages%2Fo%2Fopenafs.git no-divide-by-zero-20060616 Print nothing rather than dividing by zero if the cache manager doesn't return excessive cache params. --- diff --git a/src/venus/fs.c b/src/venus/fs.c index 0520ce166..3fd31dfad 100644 --- a/src/venus/fs.c +++ b/src/venus/fs.c @@ -2048,6 +2048,9 @@ GetCacheParmsCmd(struct cmd_syndesc *as, char *arock) printf("AFS using %5.0f%% of cache blocks (%d of %d 1k blocks)\n", percentBlocks, parms[1], parms[0]); + if (parms[2] == 0) + return 0; + filesUsed = parms[2] - parms[3]; percentFiles = ((double)filesUsed/parms[2]) * 100; printf(" %5.0f%% of the cache files (%d of %d files)\n",