diff mbox

[03/10] qtest: Assure that init_socket()'s listen() does not fail

Message ID 1398343763-10704-4-git-send-email-afaerber@suse.de
State New
Headers show

Commit Message

Andreas Färber April 24, 2014, 12:49 p.m. UTC
In practice this seems very unlikely, so cleanup is neglected, as done
for bind().

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

Comments

Stefan Hajnoczi April 24, 2014, 3:15 p.m. UTC | #1
On Thu, Apr 24, 2014 at 02:49:16PM +0200, Andreas Färber wrote:
> In practice this seems very unlikely, so cleanup is neglected, as done
> for bind().
> 
> Signed-off-by: Andreas Färber <afaerber@suse.de>
> ---
>  tests/libqtest.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
diff mbox

Patch

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;
 }