diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2011-11-08 13:19:22 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2011-11-09 11:23:16 +0100 |
commit | 6756cd2cb2d06b6a75998ef6491265e45d49f198 (patch) | |
tree | 7465951ec303b31427e6323f1c19d657667345f0 /fs | |
parent | d471e8549e81728e981ae33e302d11b55322d314 (diff) | |
download | barebox-6756cd2cb2d06b6a75998ef6491265e45d49f198.tar.gz barebox-6756cd2cb2d06b6a75998ef6491265e45d49f198.tar.xz |
fs: read: do not call read op when count is 0
Some ops do not handle read with count = 0 correctly. They do
not have to if this is catched in the upper layer.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/fs.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -503,6 +503,10 @@ int read(int fd, void *buf, size_t count) if (f->pos + count > f->size) count = f->size - f->pos; + + if (!count) + return 0; + errno = fsdrv->read(dev, f, buf, count); if (errno > 0) |