From a7d915f388355f5353f2b692a1abd7868b8307a1 Mon Sep 17 00:00:00 2001 From: Andreas Färber Date: Thu, 17 Apr 2014 18:38:25 +0200 Subject: 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 --- tests/libqtest.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests') 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; -- cgit v1.2.3-55-g7522