no-divide-by-zero-20060616
authorJim Rees <rees@umich.edu>
Fri, 16 Jun 2006 20:08:29 +0000 (20:08 +0000)
committerJim Rees <rees@umich.edu>
Fri, 16 Jun 2006 20:08:29 +0000 (20:08 +0000)
Print nothing rather than dividing by zero if the cache manager doesn't
return excessive cache params.

src/venus/fs.c

index 0520ce1..3fd31df 100644 (file)
@@ -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",