aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/libteam/libteam/0001-teamd-Pass-correct-parameter-type-to-accept-API.patch
blob: 0740601190c8b99fbe9f50049e3f9dbc2eceb12c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
From e6ba4c16da808e47891241452a927b7f558a6420 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 11 May 2024 23:11:22 -0700
Subject: [patch libteam] teamd: Pass correct parameter type to accept API

accept() expects sockaddr as second parameter

int accept (int, struct sockaddr *__restrict, socklen_t *__restrict);

Fixes build with gcc-16 on musl systems
| ../../git/teamd/teamd_usock.c: In function 'callback_usock':
| ../../git/teamd/teamd_usock.c:280:40: error: passing argument 2 of 'accept' from incompatible pointer type [-Wincompatible-pointer-types]
|   280 |         sock = accept(ctx->usock.sock, &addr, &alen);
|       |                                        ^~~~~
|       |                                        |
|       |                                        struct sockaddr_un *

Upstream-Status: Submitted [https://lists.fedorahosted.org/archives/list/libteam@lists.fedorahosted.org/2024/5/]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 teamd/teamd_usock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/teamd/teamd_usock.c b/teamd/teamd_usock.c
index 1adfdf8..5895124 100644
--- a/teamd/teamd_usock.c
+++ b/teamd/teamd_usock.c
@@ -277,7 +277,7 @@ static int callback_usock(struct teamd_context *ctx, int events, void *priv)
 	int err;
 
 	alen = sizeof(addr);
-	sock = accept(ctx->usock.sock, &addr, &alen);
+	sock = accept(ctx->usock.sock, (struct sockaddr *)&addr, &alen);
 	if (sock == -1) {
 		teamd_log_err("usock: Failed to accept connection.");
 		return -errno;
-- 
2.45.0