The preadv/pwritev call is only supposed to return a postive
number indicating how many bytes we succeed in reading from
or writing into disk, which is obviously not what we want
under the following cases.
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
int Client::preadv(int fd, const struct iovec *iov, int iovcnt, loff_t offset)
{
if (iovcnt < 0)
- return EINVAL;
+ return -EINVAL;
return _preadv_pwritev(fd, iov, iovcnt, offset, false);
}
int Client::pwritev(int fd, const struct iovec *iov, int iovcnt, int64_t offset)
{
if (iovcnt < 0)
- return EINVAL;
+ return -EINVAL;
return _preadv_pwritev(fd, iov, iovcnt, offset, true);
}