mirror of
https://passt.top/passt
synced 2025-06-18 13:05:35 +02:00
passt-repair: Build fixes for musl
When building against musl headers: - sizeof() needs stddef.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>
This commit is contained in:
parent
a9d63f91a5
commit
9215f68a0c
1 changed files with 6 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue