summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorAnthony Liguori2013-09-23 18:52:55 +0200
committerAnthony Liguori2013-09-23 18:52:55 +0200
commit2e6ae666c8ccaa7fd26d7102c5c9bed24dc02b1d (patch)
tree506ea140053974266577f7563998d7173cd5905d /util
parentMerge remote-tracking branch 'qemu-kvm/uq/master' into staging (diff)
parenttests/.gitignore: ignore test-throttle (diff)
downloadqemu-2e6ae666c8ccaa7fd26d7102c5c9bed24dc02b1d.tar.gz
qemu-2e6ae666c8ccaa7fd26d7102c5c9bed24dc02b1d.tar.xz
qemu-2e6ae666c8ccaa7fd26d7102c5c9bed24dc02b1d.zip
Merge remote-tracking branch 'mjt/trivial-patches' into staging
# By Stefan Weil (8) and others # Via Michael Tokarev * mjt/trivial-patches: tests/.gitignore: ignore test-throttle exec: Fix broken build for MinGW (regression) kvm: Fix compiler warning (clang) tcg-sparc: Fix parenthesis warning Makefile: Remove some more files when cleaning target-i386: Fix segment cache dump iov: avoid "orig_len may be used unitialized" warning vscclient: remove unnecessary use of uninitialized variable trace-events: Clean up with scripts/cleanup-trace-events.pl again tci: Fix qemu-alpha on 32 bit hosts (wrong assertions) *-user: Improve documentation for lock_user function MAINTAINERS: Add missing entry to filelist for TCI target translate-all: Fix formatting of dump output *-user: Fix typo in comment (ulocking -> unlocking) docs: Fix IO port number for CPU present bitmap. q35: Fix typo in constant DEFUALT -> DEFAULT. configure: Undefine _FORTIFY_SOURCE prior using it Message-id: 1379696296-32105-1-git-send-email-mjt@msgid.tls.msk.ru
Diffstat (limited to 'util')
-rw-r--r--util/iov.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/util/iov.c b/util/iov.c
index f705586808..bb46c04e4d 100644
--- a/util/iov.c
+++ b/util/iov.c
@@ -181,13 +181,11 @@ ssize_t iov_send_recv(int sockfd, struct iovec *iov, unsigned iov_cnt,
assert(iov[niov].iov_len > tail);
orig_len = iov[niov].iov_len;
iov[niov++].iov_len = tail;
- }
-
- ret = do_send_recv(sockfd, iov, niov, do_send);
-
- /* Undo the changes above before checking for errors */
- if (tail) {
+ ret = do_send_recv(sockfd, iov, niov, do_send);
+ /* Undo the changes above before checking for errors */
iov[niov-1].iov_len = orig_len;
+ } else {
+ ret = do_send_recv(sockfd, iov, niov, do_send);
}
if (offset) {
iov[0].iov_base -= offset;