Don't error out on zero-length chunks in writev, as to mimic Linux (Kirill A. Shutemov).
authorbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>
Sun, 10 Feb 2008 13:28:08 +0000 (13:28 +0000)
committerbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>
Sun, 10 Feb 2008 13:28:08 +0000 (13:28 +0000)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3970 c046a42c-6fe2-441c-8c8c-71466251a162

linux-user/syscall.c

index 70aff84..e8b49ca 100644 (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 */