diff options
-rw-r--r-- | coreutils/dd.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/coreutils/dd.c b/coreutils/dd.c index 768a12995..f2e1a1683 100644 --- a/coreutils/dd.c +++ b/coreutils/dd.c | |||
@@ -73,9 +73,9 @@ static void dd_output_status(int UNUSED_PARAM cur_signal) | |||
73 | * (sleep 1; echo DONE) | ./busybox dd >/dev/null | 73 | * (sleep 1; echo DONE) | ./busybox dd >/dev/null |
74 | */ | 74 | */ |
75 | diff_us -= G.begin_time_us; | 75 | diff_us -= G.begin_time_us; |
76 | /* We need to calculate "(total * 1M) / usec" without overflow. | 76 | /* We need to calculate "(total * 1000000) / usec" without overflow. |
77 | * this would work too, but is bigger than integer code below. | 77 | * this would work too, but is bigger than integer code below. |
78 | * total = G.total_bytes * (double)(1024 * 1024) / (diff_us ? diff_us : 1); | 78 | * total = G.total_bytes * (double)1000000 / (diff_us ? diff_us : 1); |
79 | */ | 79 | */ |
80 | diff_scaled = diff_us; | 80 | diff_scaled = diff_us; |
81 | total = G.total_bytes; | 81 | total = G.total_bytes; |
@@ -83,7 +83,7 @@ static void dd_output_status(int UNUSED_PARAM cur_signal) | |||
83 | total >>= 1; | 83 | total >>= 1; |
84 | diff_scaled >>= 1; | 84 | diff_scaled >>= 1; |
85 | } | 85 | } |
86 | total *= (1024 * 1024); | 86 | total *= (1024 * 1024); /* should be 1000000, but it's +45 bytes */ |
87 | if (diff_scaled > 1) | 87 | if (diff_scaled > 1) |
88 | total /= diff_scaled; | 88 | total /= diff_scaled; |
89 | fprintf(stderr, "%f seconds, %sB/s\n", | 89 | fprintf(stderr, "%f seconds, %sB/s\n", |