From 403fbbbc3411a3dccc80f0c0798b0c2c9924eda9 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Thu, 13 Feb 2014 10:10:43 +0100 Subject: 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 --- fs/fs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'fs') 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); -- cgit v1.2.3