From: Andreas Färber Date: Thu, 17 Apr 2014 16:38:25 +0000 (+0200) Subject: qtest: Add error reporting to socket_accept() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=a7d915f388355f5353f2b692a1abd7868b8307a1;p=qemu.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 Signed-off-by: Andreas Färber --- diff --git a/tests/libqtest.c b/tests/libqtest.c index 232f781639..4b90d9112a 100644 --- a/tests/libqtest.c +++ b/tests/libqtest.c @@ -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;