aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--slirp/socket.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/slirp/socket.c b/slirp/socket.c
index 6713c4d5e7..47ed44b937 100644
--- a/slirp/socket.c
+++ b/slirp/socket.c
@@ -352,8 +352,12 @@ sowrite(so)
}
#ifndef HAVE_READV
- if (n == 2 && nn == iov[0].iov_len)
- nn += send(so->s, iov[1].iov_base, iov[1].iov_len,0);
+ if (n == 2 && nn == iov[0].iov_len) {
+ int ret;
+ ret = send(so->s, iov[1].iov_base, iov[1].iov_len,0);
+ if (ret > 0)
+ nn += ret;
+ }
DEBUG_MISC((dfd, " ... wrote nn = %d bytes\n", nn));
#endif