Don't error out on zero-length chunks in writev, as to mimic Linux (Kirill A. Shutemov).

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3970 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
balrog 2008-02-10 13:28:08 +00:00
parent ff99363847
commit 7bedce8d85

View File

@ -1029,7 +1029,7 @@ static abi_long lock_iovec(int type, struct iovec *vec, abi_ulong target_addr,
vec[i].iov_len = tswapl(target_vec[i].iov_len);
if (vec[i].iov_len != 0) {
vec[i].iov_base = lock_user(type, base, vec[i].iov_len, copy);
if (!vec[i].iov_base)
if (!vec[i].iov_base && vec[i].iov_len)
goto fail;
} else {
/* zero length pointer is ignored */