9
0
Fork 0

read_file: Use read_full

At least NFS does not fulfill read requests > 1024 bytes at once.
Use read_full in read_file as read doesn't guarantee that the
whole request can be read at once.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Sascha Hauer 2014-02-13 10:10:43 +01:00
parent b069d6b876
commit 403fbbbc34
1 changed files with 2 additions and 1 deletions

View File

@ -60,7 +60,8 @@ again:
if (fd < 0)
goto err_out;
if (read(fd, buf, s.st_size) < s.st_size)
ret = read_full(fd, buf, s.st_size);
if (ret < 0)
goto err_out1;
close(fd);