Commit 7bedce8d85a0f1d8b1b2a87618cde4c1e3f53976
1 parent
ff993638
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
Showing
1 changed file
with
1 additions
and
1 deletions
linux-user/syscall.c
... | ... | @@ -1029,7 +1029,7 @@ static abi_long lock_iovec(int type, struct iovec *vec, abi_ulong target_addr, |
1029 | 1029 | vec[i].iov_len = tswapl(target_vec[i].iov_len); |
1030 | 1030 | if (vec[i].iov_len != 0) { |
1031 | 1031 | vec[i].iov_base = lock_user(type, base, vec[i].iov_len, copy); |
1032 | - if (!vec[i].iov_base) | |
1032 | + if (!vec[i].iov_base && vec[i].iov_len) | |
1033 | 1033 | goto fail; |
1034 | 1034 | } else { |
1035 | 1035 | /* zero length pointer is ignored */ | ... | ... |