summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2021-02-22 10:39:38 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2021-02-22 10:39:38 +0100
commit71f28d7e89bdd96f671959180ab78f9cce287927 (patch)
tree61379d90c1b89cdf60def60951289f2724494259 /lib
parent34d4be79d78569e6800c6fc59bfeb8b7c0ea2f5b (diff)
parent129e3317a6b283cb7bb10eb8cb0f531b603893c0 (diff)
downloadbarebox-71f28d7e89bdd96f671959180ab78f9cce287927.tar.gz
barebox-71f28d7e89bdd96f671959180ab78f9cce287927.tar.xz
Merge branch 'for-next/ext4'
Diffstat (limited to 'lib')
-rw-r--r--lib/libfile.c2
-rw-r--r--lib/show_progress.c17
2 files changed, 9 insertions, 10 deletions
diff --git a/lib/libfile.c b/lib/libfile.c
index 20bb689a79..4ab8db11ad 100644
--- a/lib/libfile.c
+++ b/lib/libfile.c
@@ -332,7 +332,7 @@ int copy_file(const char *src, const char *dst, int verbose)
int r, s;
int ret = 1, err1 = 0;
int mode;
- int total = 0;
+ loff_t total = 0;
struct stat srcstat, dststat;
rw_buf = xmalloc(RW_BUF_SIZE);
diff --git a/lib/show_progress.c b/lib/show_progress.c
index 259fb7ab19..1be06ea780 100644
--- a/lib/show_progress.c
+++ b/lib/show_progress.c
@@ -19,13 +19,13 @@
#include <progress.h>
#include <linux/math64.h>
-#define HASHES_PER_LINE 65
+#define HASHES_PER_LINE 64
-static int printed;
-static int progress_max;
-static int spin;
+static loff_t printed;
+static loff_t progress_max;
+static unsigned spin;
-void show_progress(int now)
+void show_progress(loff_t now)
{
char spinchr[] = "\\|/-";
@@ -35,9 +35,8 @@ void show_progress(int now)
}
if (progress_max && progress_max != FILESIZE_MAX) {
- uint64_t tmp = (int64_t)now * HASHES_PER_LINE;
- do_div(tmp, progress_max);
- now = tmp;
+ uint64_t tmp = now * HASHES_PER_LINE;
+ now = div64_u64(tmp, progress_max);
}
while (printed < now) {
@@ -48,7 +47,7 @@ void show_progress(int now)
}
}
-void init_progression_bar(int max)
+void init_progression_bar(loff_t max)
{
printed = 0;
progress_max = max;