libfile: Do not return 0 from write_full()
None of the callers of write_full() expect a zero return value. Given
how the documentation explicitly states that either all of the buffer
is going to be written out or an error generated, treat 0 retrun from
write() as a error, set errno to ENOSPC and return -1.

Same logic applies to pwrite_full() as well, so make the change there
while at it.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1 parent 6ce2ee8 commit 8f945131a18e68121f6e7ea4c12992a5eb108466
@Andrey Smirnov Andrey Smirnov authored on 28 May 2019
Sascha Hauer committed on 28 May 2019
Showing 1 changed file
View
lib/libfile.c