From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: Richard Henderson <richard.henderson@linaro.org>, qemu-devel@nongnu.org
Cc: alex.bennee@linaro.org
Subject: Re: [PATCH] tests/tcg/linux-test: Adjust getsockname for musl
Date: Mon, 5 Oct 2020 19:23:15 +0200 [thread overview]
Message-ID: <dc569ee2-fe47-0967-3239-01ced7a3aebd@amsat.org> (raw)
In-Reply-To: <20201005165850.88425-1-richard.henderson@linaro.org>
On 10/5/20 6:58 PM, Richard Henderson wrote:
> 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.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> tests/tcg/multiarch/linux-test.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/tcg/multiarch/linux-test.c b/tests/tcg/multiarch/linux-test.c
> index 8a7c15cd31..96bbad5823 100644
> --- a/tests/tcg/multiarch/linux-test.c
> +++ b/tests/tcg/multiarch/linux-test.c
> @@ -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);
>
>
next prev parent reply other threads:[~2020-10-05 17:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-05 16:58 [PATCH] tests/tcg/linux-test: Adjust getsockname for musl Richard Henderson
2020-10-05 17:23 ` Philippe Mathieu-Daudé [this message]
2020-10-05 17:29 ` Richard Henderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=dc569ee2-fe47-0967-3239-01ced7a3aebd@amsat.org \
--to=f4bug@amsat.org \
--cc=alex.bennee@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).