From: Lennart Poettering Date: Tue, 3 Jul 2012 19:22:08 +0000 (+0200) Subject: readahead: fix calculation of percentage X-Git-Tag: v187~170 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=047e111bdddfed52dabc7ff8242c2eec78e126fb;hp=2d938ac75d013f713c1225def78a53583af6a596 readahead: fix calculation of percentage --- diff --git a/src/readahead/readahead-analyze.c b/src/readahead/readahead-analyze.c index 8f1d7f9c4..53892b0cf 100644 --- a/src/readahead/readahead-analyze.c +++ b/src/readahead/readahead-analyze.c @@ -115,7 +115,7 @@ int main_analyze(const char *pack_path) { tsize += size; printf(" %4d%% (%2d) %12ld: %s\n", - sections ? (int)(size / st.st_size * 100.0) : 100, + sections ? (int) (size * 100 / st.st_size) : 100, sections ? sections : 1, (unsigned long)size, path);