9
0
Fork 0

[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
6574529bb5 detects a false positive if the
length is zero.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This commit is contained in:
Marc Kleine-Budde 2007-12-23 20:07:03 +01:00
parent 85bacf61f6
commit 5c2afd89e1
1 changed files with 3 additions and 0 deletions

View File

@ -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);