LibC: Fix {read,write}v return value for partial actions
This commit is contained in:
parent
8794122c2d
commit
9809f87010
|
|
@ -20,9 +20,10 @@ ssize_t readv(int fildes, const struct iovec* iov, int iovcnt)
|
||||||
if (ret <= 0)
|
if (ret <= 0)
|
||||||
return result;
|
return result;
|
||||||
nread += ret;
|
nread += ret;
|
||||||
|
result += ret;
|
||||||
}
|
}
|
||||||
result += nread;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -44,8 +45,9 @@ ssize_t writev(int fildes, const struct iovec* iov, int iovcnt)
|
||||||
if (ret <= 0)
|
if (ret <= 0)
|
||||||
return result;
|
return result;
|
||||||
nwrite += ret;
|
nwrite += ret;
|
||||||
|
result += ret;
|
||||||
}
|
}
|
||||||
result += nwrite;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue