Commit 22a28304 authored by Reda NOUSHI's avatar Reda NOUSHI Committed by Julius Plenz

cachestats: Don't treat empty files differently

parent 359fad8d
...@@ -57,8 +57,10 @@ int main(int argc, char *argv[]) ...@@ -57,8 +57,10 @@ int main(int argc, char *argv[])
return EXIT_FAILURE; return EXIT_FAILURE;
} }
if(st.st_size == 0) { if(st.st_size == 0) {
fprintf(stderr, "%s: file size is 0!\n", argv[1]); printf("pages in cache: %d/%d (%.1f%%) [filesize=%.1fK, "
return EXIT_FAILURE; "pagesize=%dK]\n", 0, 0, 0.0,
0.0, PAGESIZE / 1024);
return EXIT_SUCCESS;
} }
pages = (st.st_size + PAGESIZE - 1) / PAGESIZE; pages = (st.st_size + PAGESIZE - 1) / PAGESIZE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment