aboutsummaryrefslogtreecommitdiff
path: root/tests/libqtest.c
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2014-04-17 18:38:25 +0200
committerAndreas Färber <afaerber@suse.de>2014-05-05 20:58:33 +0200
commita7d915f388355f5353f2b692a1abd7868b8307a1 (patch)
tree83bb76ea9c2f10b31ffb11264648ebf158215034 /tests/libqtest.c
parenta7ded163dbe548075d65219c6189f059da2d99bb (diff)
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>
Diffstat (limited to 'tests/libqtest.c')
-rw-r--r--tests/libqtest.c3
1 files changed, 3 insertions, 0 deletions
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;