Commit 3bc2175dcc62d699c4b0a0b9c6bb2ae37bcb66b7

Authored by bellard
1 parent bed5cd80

socket send fix


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1158 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 6 additions and 2 deletions
slirp/socket.c
... ... @@ -352,8 +352,12 @@ sowrite(so)
352 352 }
353 353  
354 354 #ifndef HAVE_READV
355   - if (n == 2 && nn == iov[0].iov_len)
356   - nn += send(so->s, iov[1].iov_base, iov[1].iov_len,0);
  355 + if (n == 2 && nn == iov[0].iov_len) {
  356 + int ret;
  357 + ret = send(so->s, iov[1].iov_base, iov[1].iov_len,0);
  358 + if (ret > 0)
  359 + nn += ret;
  360 + }
357 361 DEBUG_MISC((dfd, " ... wrote nn = %d bytes\n", nn));
358 362 #endif
359 363  
... ...