diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2014-02-13 10:10:43 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2014-02-13 11:18:55 +0100 |
commit | 403fbbbc3411a3dccc80f0c0798b0c2c9924eda9 (patch) | |
tree | 90e283db9803e58f4aed4eb23895064291f3ae4d /fs | |
parent | b069d6b876064b8eca973882157f172a9ccefcab (diff) | |
download | barebox-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.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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); |