qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 03/10] qtest: Assure that init_socket()'s listen() d


From: Andreas Färber
Subject: [Qemu-devel] [PATCH 03/10] qtest: Assure that init_socket()'s listen() does not fail
Date: Thu, 24 Apr 2014 14:49:16 +0200

In practice this seems very unlikely, so cleanup is neglected, as done
for bind().

Signed-off-by: Andreas Färber <address@hidden>
---
 tests/libqtest.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/libqtest.c b/tests/libqtest.c
index 8155695..232f781 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;
 }
-- 
1.8.4.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]