fix: usrsock iovec_do skip empty iov
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
parent
f60480a5db
commit
4c693239c0
@ -143,7 +143,7 @@ static ssize_t iovec_do(FAR void *srcdst, size_t srcdstlen,
|
||||
|
||||
/* Rewind to correct position. */
|
||||
|
||||
while (pos > 0 && iovcnt > 0)
|
||||
while (pos >= 0 && iovcnt > 0)
|
||||
{
|
||||
if (iov->iov_len <= pos)
|
||||
{
|
||||
@ -222,7 +222,7 @@ static ssize_t iovec_do(FAR void *srcdst, size_t srcdstlen,
|
||||
}
|
||||
}
|
||||
|
||||
return total == 0 && iovcnt == 0 ? -1: total;
|
||||
return total;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
Loading…
Reference in New Issue
Block a user