[systemd-commits] src/readahead

Lennart Poettering lennart at kemper.freedesktop.org
Tue Jul 3 12:22:35 PDT 2012


 src/readahead/readahead-analyze.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 047e111bdddfed52dabc7ff8242c2eec78e126fb
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Jul 3 21:22:08 2012 +0200

    readahead: fix calculation of percentage

diff --git a/src/readahead/readahead-analyze.c b/src/readahead/readahead-analyze.c
index 8f1d7f9..53892b0 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);



More information about the systemd-commits mailing list