git://git.openafs.org
/
openafs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
176c2fd
)
no-divide-by-zero-20060616
author
Jim Rees
<rees@umich.edu>
Fri, 16 Jun 2006 20:08:29 +0000 (20:08 +0000)
committer
Jim 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
patch
|
blob
|
history
diff --git
a/src/venus/fs.c
b/src/venus/fs.c
index
0520ce1
..
3fd31df
100644
(file)
--- 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",