libfile: have write_full return a descriptive error code
So far (p|)write_full has been returning -1 on error.
Some callers of write_full like imx_bbu_write_device print out the
function's return value on error, effectively rendering every printed
error message to be due to EPERM.

On the other hand, some callers like do_memcpy, use it correctly and
use errno. Sidestep the issue by having the function return -errno on
errors as well.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1 parent f32a61b commit aba7cdb357e3d442359c29f7caefc49464bfd812
@Ahmad Fatoum Ahmad Fatoum authored on 22 Aug 2019
Sascha Hauer committed on 30 Aug 2019
Showing 1 changed file
View
lib/libfile.c