lib: libfile: Fix copying files to a non existing destination
If the destination file does not exist the stat call to check the file
type fails. Extend the check of the stat return value.
To allow to copy files to a new destination.

Fixes commit 0ec6bd3e1be8 ("libfile: copy_file: Only open
regular files with O_TRUNC")

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1 parent e1e8656 commit d7253200f53a2a3ca3739f2b2bf106ee6ba09496
@Teresa Remmet Teresa Remmet authored on 16 Jan 2017
Sascha Hauer committed on 17 Jan 2017
Showing 1 changed file
View
lib/libfile.c