[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:
parent
85bacf61f6
commit
5c2afd89e1
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue