diff options
author | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2012-09-07 09:41:30 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-09-07 10:27:15 +0200 |
commit | 361d5bd7730befeaea63c53dd3d22fac6914a966 (patch) | |
tree | cdada794e067fe8ca44f38db6f481fca4a9aaae7 | |
parent | 38d288b4e60470251f075bfb2a01f073419895e9 (diff) | |
download | barebox-361d5bd7730befeaea63c53dd3d22fac6914a966.tar.gz barebox-361d5bd7730befeaea63c53dd3d22fac6914a966.tar.xz |
fs/nfs: fix read when size < 1024
Currently we always request 1024.
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | fs/nfs.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -819,7 +819,11 @@ static int nfs_read(struct device_d *dev, FILE *file, void *buf, size_t insize) insize -= now; if (insize) { - now = 1024; + /* do not use min as insize is a size_t */ + if (insize < 1024) + now = insize; + else + now = 1024; if (pos + now > file->size) now = file->size - pos; |