From: David Gibson <david@gibson.dropbear.id.au>
To: Stefano Brivio <sbrivio@redhat.com>
Cc: passt-dev@passt.top
Subject: Re: [PATCH] passt-repair: Build fixes for musl
Date: Thu, 6 Feb 2025 09:31:09 +1100 [thread overview]
Message-ID: <Z6PmrYHRQGOe7U4B@zatzit> (raw)
In-Reply-To: <20250205160006.3780783-1-sbrivio@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1507 bytes --]
On Wed, Feb 05, 2025 at 05:00:06PM +0100, Stefano Brivio wrote:
> When building against musl headers:
>
> - sizeof() needs sttdef.h, as it should be;
>
> - we can't initialise a struct msghdr by simply listing fields in
> order, as they contain explicit padding fields. Use field names
> instead.
>
> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
> ---
> passt-repair.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/passt-repair.c b/passt-repair.c
> index 6f79423..3c3247b 100644
> --- a/passt-repair.c
> +++ b/passt-repair.c
> @@ -21,6 +21,7 @@
> #include <sys/socket.h>
> #include <sys/un.h>
> #include <errno.h>
> +#include <stddef.h>
> #include <stdio.h>
> #include <stdlib.h>
> #include <string.h>
> @@ -75,7 +76,11 @@ int main(int argc, char **argv)
> }
>
> iov = (struct iovec){ &cmd, sizeof(cmd) };
> - msg = (struct msghdr){ NULL, 0, &iov, 1, buf, sizeof(buf), 0 };
> + msg = (struct msghdr){ .msg_name = NULL, .msg_namelen = 0,
> + .msg_iov = &iov, .msg_iovlen = 1,
> + .msg_control = buf,
> + .msg_controllen = sizeof(buf),
> + .msg_flags = 0 };
> cmsg = CMSG_FIRSTHDR(&msg);
>
> if (argc != 2) {
--
David Gibson (he or they) | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you, not the other way
| around.
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2025-02-05 22:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-05 16:00 [PATCH] passt-repair: Build fixes for musl Stefano Brivio
2025-02-05 16:06 ` Stefano Brivio
2025-02-05 22:31 ` David Gibson [this message]
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=Z6PmrYHRQGOe7U4B@zatzit \
--to=david@gibson.dropbear.id.au \
--cc=passt-dev@passt.top \
--cc=sbrivio@redhat.com \
/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.
Code repositories for project(s) associated with this public inbox
https://passt.top/passt
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 IMAP folder(s).