summaryrefslogtreecommitdiffstats
path: root/lib/libfile.c
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2021-02-16 21:02:08 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2021-02-19 08:42:32 +0100
commit129e3317a6b283cb7bb10eb8cb0f531b603893c0 (patch)
tree511e2cf2cbb0ed316feb61c11bb92b93711c5aee /lib/libfile.c
parentf53b916b01e26ed200718b9ed736fea18605ce9c (diff)
downloadbarebox-129e3317a6b283cb7bb10eb8cb0f531b603893c0.tar.gz
barebox-129e3317a6b283cb7bb10eb8cb0f531b603893c0.tar.xz
copy_file: fix progress bar for files larger than 2G
Files larger than 2G cause the benign bug, that the progress bar is no longer accurate. Use loff_t to fix this. Note that printed % HASHES_PER_LINE in show_progress implies a 64-bit division. A previous commit changed the constant divisor to a power of two, so a division shouldn't be generated. The original multiplication and modulo operations are left as is for clarity. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'lib/libfile.c')
-rw-r--r--lib/libfile.c2
1 files changed, 1 insertions, 1 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);