From a7ded163dbe548075d65219c6189f059da2d99bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Thu, 17 Apr 2014 18:19:14 +0200 Subject: qtest: Assure that init_socket()'s listen() does not fail MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In practice this seems very unlikely, so cleanup is neglected, as done for bind(). Reviewed-by: Stefan Hajnoczi Signed-off-by: Andreas Färber --- tests/libqtest.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests/libqtest.c') 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; } -- cgit v1.2.3