mirror of https://github.com/xemu-project/xemu.git
qtest: Add error reporting to socket_accept()
We're not using the GLib infrastructure here, to allow cleaning up the sockets. Still, knowing why a certain test run failed can be valuable. Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
parent
a7ded163db
commit
a7d915f388
|
@ -93,6 +93,9 @@ static int socket_accept(int sock)
|
|||
do {
|
||||
ret = accept(sock, (struct sockaddr *)&addr, &addrlen);
|
||||
} while (ret == -1 && errno == EINTR);
|
||||
if (ret == -1) {
|
||||
fprintf(stderr, "%s failed: %s\n", __func__, strerror(errno));
|
||||
}
|
||||
close(sock);
|
||||
|
||||
return ret;
|
||||
|
|
Loading…
Reference in New Issue