Skip to content

Commit

Permalink
qtest: Assure that init_socket()'s listen() does not fail
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
afaerber committed May 5, 2014
1 parent 4688c94 commit a7ded16
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/libqtest.c
Expand Up @@ -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;
}
Expand Down

0 comments on commit a7ded16

Please sign in to comment.