summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2014-02-13 10:10:43 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2014-02-13 11:18:55 +0100
commit403fbbbc3411a3dccc80f0c0798b0c2c9924eda9 (patch)
tree90e283db9803e58f4aed4eb23895064291f3ae4d /fs
parentb069d6b876064b8eca973882157f172a9ccefcab (diff)
downloadbarebox-403fbbbc3411a3dccc80f0c0798b0c2c9924eda9.tar.gz
barebox-403fbbbc3411a3dccc80f0c0798b0c2c9924eda9.tar.xz
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>
Diffstat (limited to 'fs')
-rw-r--r--fs/fs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/fs.c b/fs/fs.c
index 32dba8cf0a..1b43c616ba 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -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);