aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2014-04-17 18:19:14 +0200
committerAndreas Färber <afaerber@suse.de>2014-05-05 20:58:33 +0200
commita7ded163dbe548075d65219c6189f059da2d99bb (patch)
tree174c81637f091ba85a4ae64768091e6d5e94eb97 /tests
parent4688c94c1f59b8df45079391e26569d0615ab7af (diff)
qtest: Assure that init_socket()'s listen() does not fail
In practice this seems very unlikely, so cleanup is neglected, as done for bind(). Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'tests')
-rw-r--r--tests/libqtest.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/libqtest.c b/tests/libqtest.c
index 8155695848..232f781639 100644
--- a/tests/libqtest.c
+++ b/tests/libqtest.c
@@ -72,7 +72,8 @@ static int init_socket(const char *socket_path)
ret = bind(sock, (struct sockaddr *)&addr, sizeof(addr));
} while (ret == -1 && errno == EINTR);
g_assert_no_errno(ret);
- listen(sock, 1);
+ ret = listen(sock, 1);
+ g_assert_no_errno(ret);
return sock;
}