libfile: copy_file: Only open regular files with O_TRUNC
Device files can not truncate in the most cases. Check if the
destination is a regular file and open only those with O_TRUNC.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1 parent c580e84 commit 0ec6bd3e1be84da991091fab5bbe20f168471a39
@Teresa Remmet Teresa Remmet authored on 25 Nov 2016
Sascha Hauer committed on 11 Jan 2017
Showing 1 changed file
View
lib/libfile.c