aboutsummaryrefslogtreecommitdiff
path: root/tests/tcg/multiarch
diff options
context:
space:
mode:
authorIlya Leoshkevich <iii@linux.ibm.com>2022-07-25 16:42:51 +0200
committerThomas Huth <thuth@redhat.com>2022-08-01 07:27:56 +0200
commitb9e6074fc5b429b1e956e9c60db7e284a91e0f3d (patch)
tree3e79460a3c96069330f82a93990fdefe83fdd91b /tests/tcg/multiarch
parent3916603e0c1d909e14e09d5ebcbdaa9c9e21adf3 (diff)
downloadqemu-b9e6074fc5b429b1e956e9c60db7e284a91e0f3d.zip
qemu-b9e6074fc5b429b1e956e9c60db7e284a91e0f3d.tar.gz
qemu-b9e6074fc5b429b1e956e9c60db7e284a91e0f3d.tar.bz2
tests/tcg/linux-test: Fix random hangs in test_socket
test_socket hangs randomly in connect(), especially when run without qemu. Apparently the reason is that linux started treating backlog value of 0 literally instead of rounding it up since v4.4 (commit ef547f2ac16b). So set it to 1 instead. Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com> Message-Id: <20220725144251.192720-1-iii@linux.ibm.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'tests/tcg/multiarch')
-rw-r--r--tests/tcg/multiarch/linux/linux-test.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/tcg/multiarch/linux/linux-test.c b/tests/tcg/multiarch/linux/linux-test.c
index 019d817..5a2a4f2 100644
--- a/tests/tcg/multiarch/linux/linux-test.c
+++ b/tests/tcg/multiarch/linux/linux-test.c
@@ -263,7 +263,7 @@ static int server_socket(void)
sockaddr.sin_port = htons(0); /* choose random ephemeral port) */
sockaddr.sin_addr.s_addr = 0;
chk_error(bind(fd, (struct sockaddr *)&sockaddr, sizeof(sockaddr)));
- chk_error(listen(fd, 0));
+ chk_error(listen(fd, 1));
return fd;
}