Skip to content

Commit

Permalink
tests/tcg/linux-test: Adjust getsockname for musl
Browse files Browse the repository at this point in the history
Unlike glibc, musl does not use transparent unions to hide
the different structures that overlap struct sockaddr.

Add an explicit cast to work around this.

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
  • Loading branch information
rth7680 committed Oct 15, 2020
1 parent 57c98ea commit 51f22c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/tcg/multiarch/linux-test.c
Expand Up @@ -296,7 +296,7 @@ static void test_socket(void)
server_fd = server_socket();
/* find out what port we got */
socklen = sizeof(server_addr);
ret = getsockname(server_fd, &server_addr, &socklen);
ret = getsockname(server_fd, (struct sockaddr *)&server_addr, &socklen);
chk_error(ret);
server_port = ntohs(server_addr.sin_port);

Expand Down

0 comments on commit 51f22c1

Please sign in to comment.