libfile: copy_file: Fix calling discard_range
discard range is called with unitialized size argument. Call it after
stat() on the source filedescriptor. Also there's no point in continuing
when stat() on the source filedescriptor fails, so bail out in this
case.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1 parent 5edb9f0 commit e9fb40763b6de1aaf889ba07529eed68f20f55c3
@Sascha Hauer Sascha Hauer authored on 12 Jun 2020
Showing 1 changed file
View
lib/libfile.c