summaryrefslogtreecommitdiffstats
path: root/arch/sandbox/lib
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2007-12-23 20:07:03 +0100
committerMarc Kleine-Budde <mkl@pengutronix.de>2008-01-02 21:48:31 +0100
commit5c2afd89e1e0d2cddbc634890cae377f4392990e (patch)
treece583bfaa34f6eb8e7242a711ff9d95d1c826ef3 /arch/sandbox/lib
parent85bacf61f65c766ad3e9ea259402fae6cba5465a (diff)
downloadbarebox-5c2afd89e1e0d2cddbc634890cae377f4392990e.tar.gz
barebox-5c2afd89e1e0d2cddbc634890cae377f4392990e.tar.xz
[sandbox] fix read for buffers of zero length
This patch fixes the read function for the linux sandbox if a buffer of zero length should be read. The error handling introduced in 6574529bb5a233278e9886a93afeed70e9993b54 detects a false positive if the length is zero. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'arch/sandbox/lib')
-rw-r--r--arch/sandbox/lib/common.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/sandbox/lib/common.c b/arch/sandbox/lib/common.c
index 5e08a6b197..0924c9bb9a 100644
--- a/arch/sandbox/lib/common.c
+++ b/arch/sandbox/lib/common.c
@@ -148,6 +148,9 @@ int linux_read(int fd, void *buf, size_t count)
{
ssize_t ret;
+ if (count == 0)
+ return 0;
+
do {
ret = read(fd, buf, count);