blob: 5d3e8d4e8448e053d24799e2d05e4cc0ef8acfe8 [file] [log] [blame]
Andrew Geisslereff27472021-10-29 15:35:00 -05001From 85cf3d58ff1a9696f0754feffae7d81b8d1d9a43 Mon Sep 17 00:00:00 2001
Andrew Geissler635e0e42020-08-21 15:58:33 -05002From: Alex Kiernan <alex.kiernan@gmail.com>
3Date: Fri, 7 Aug 2020 15:20:17 +0000
William A. Kennington IIIac69b482021-06-02 12:28:27 -07004Subject: [PATCH] Fix incompatible pointer type struct sockaddr_un *
Andrew Geissler635e0e42020-08-21 15:58:33 -05005
6| ../../../../../../workspace/sources/systemd/src/nspawn/nspawn.c: In function 'cant_be_in_netns':
7| ../../../../../../workspace/sources/systemd/src/nspawn/nspawn.c:4893:25: error: passing argument 2 of 'connect' from incompatible pointer type [-Werror=incompatible-pointer-types]
8| 4893 | if (connect(fd, &sa.un, SOCKADDR_UN_LEN(sa.un)) < 0) {
9| | ^~~~~~
10| | |
11| | struct sockaddr_un *
12| In file included from ../../../../../../workspace/sources/systemd/src/systemd/sd-daemon.h:22,
13| from ../../../../../../workspace/sources/systemd/src/nspawn/nspawn.c:21:
14| /home/ubuntu/poky/build/tmp/work/core2-64-poky-linux-musl/systemd/1_246-r0/recipe-sysroot/usr/include/sys/socket.h:384:19: note: expected 'const struct sockaddr *' but argument is of type 'struct sockaddr_un *'
15| 384 | int connect (int, const struct sockaddr *, socklen_t);
16| | ^~~~~~~~~~~~~~~~~~~~~~~
17| cc1: some warnings being treated as errors
18
19Upstream-Status: Inappropriate [musl specific]
20Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
William A. Kennington IIIac69b482021-06-02 12:28:27 -070021
Andrew Geissler635e0e42020-08-21 15:58:33 -050022---
23 src/nspawn/nspawn.c | 2 +-
24 1 file changed, 1 insertion(+), 1 deletion(-)
25
26diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
Andrew Geisslereff27472021-10-29 15:35:00 -050027index 575b9da447..ff08ed23cc 100644
Andrew Geissler635e0e42020-08-21 15:58:33 -050028--- a/src/nspawn/nspawn.c
29+++ b/src/nspawn/nspawn.c
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050030@@ -5354,7 +5354,7 @@ static int cant_be_in_netns(void) {
Andrew Geissler635e0e42020-08-21 15:58:33 -050031 if (fd < 0)
32 return log_error_errno(errno, "Failed to allocate udev control socket: %m");
33
Andrew Geisslereff27472021-10-29 15:35:00 -050034- if (connect(fd, &sa.sa, SOCKADDR_UN_LEN(sa.un)) < 0) {
35+ if (connect(fd, (struct sockaddr *)&sa.sa, SOCKADDR_UN_LEN(sa.un)) < 0) {
Andrew Geissler635e0e42020-08-21 15:58:33 -050036
37 if (errno == ENOENT || ERRNO_IS_DISCONNECT(errno))
38 return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP),