summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAndreas Färber <andreas.faerber@web.de>2012-05-28 00:53:20 +0200
committerStefan Hajnoczi <stefanha@linux.vnet.ibm.com>2012-06-22 09:41:31 +0100
commitb34d259516ae2377186171c58c3bc535eb9ed263 (patch)
tree2169338f0bd564467e42aba2712331884db2e816 /tests
parentfc8c5b8c41ee5ba69d7a2be63b02a08c7b0b155b (diff)
downloadqemu-b34d259516ae2377186171c58c3bc535eb9ed263.zip
libqtest: Fix socket_accept() to pass address_len
accept() expects address_len to point to the length of the sockaddr on input. Initialize it accordingly. Resolves an assertion due to EFAULT on illumos. Signed-off-by: Andreas Färber <andreas.faerber@web.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/libqtest.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/libqtest.c b/tests/libqtest.c
index 6d333ef0ac..1d73fd1953 100644
--- a/tests/libqtest.c
+++ b/tests/libqtest.c
@@ -74,6 +74,7 @@ static int socket_accept(int sock)
socklen_t addrlen;
int ret;
+ addrlen = sizeof(addr);
do {
ret = accept(sock, (struct sockaddr *)&addr, &addrlen);
} while (ret == -1 && errno == EINTR);