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>
This commit is contained in:
Andreas Färber 2012-05-28 00:53:20 +02:00 committed by Stefan Hajnoczi
parent fc8c5b8c41
commit b34d259516

View File

@ -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);