提交 b34d2595 编写于 作者: A Andreas Färber 提交者: Stefan Hajnoczi

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: NAndreas Färber <andreas.faerber@web.de>
Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
上级 fc8c5b8c
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册