discard the range in the output file we are going to overwrite anyway. Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx> --- lib/libfile.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/libfile.c b/lib/libfile.c index 5a1817e32a..dbeed12ccd 100644 --- a/lib/libfile.c +++ b/lib/libfile.c @@ -367,6 +367,8 @@ int copy_file(const char *src, const char *dst, int verbose) goto out; } + discard_range(dstfd, srcstat.st_size, 0); + if (verbose) { if (stat(src, &srcstat) < 0) srcstat.st_size = 0; -- 2.24.0 _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox