chiark / gitweb /
readahead: fix calculation of percentage
[elogind.git] / src / readahead / readahead-analyze.c
index fb50ad371e8da1d2b7fba01a9e0a9eb505d2930a..53892b0cf862bf03a60d1e6348e3de3dfb6c8b53 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);
@@ -143,7 +143,6 @@ int main_analyze(const char *pack_path) {
 
         return EXIT_SUCCESS;
 
-
 fail:
         fclose(pack);
         return EXIT_FAILURE;