chiark / gitweb /
readahead: fix calculation of percentage
authorLennart Poettering <lennart@poettering.net>
Tue, 3 Jul 2012 19:22:08 +0000 (21:22 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 3 Jul 2012 19:22:08 +0000 (21:22 +0200)
src/readahead/readahead-analyze.c

index 8f1d7f9..53892b0 100644 (file)
@@ -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);