From 0629ec8976b1d56c17db51805f647bf35f4bfd3b Mon Sep 17 00:00:00 2001 From: Jeremy Kerr Date: Fri, 18 Oct 2024 11:39:46 +0800 Subject: [PATCH] mctp-ops: Include mctp.h for AF_MCTP definition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We're currently failing on musl with: [3/4] Compiling C object mctp.p/src_mctp-ops.c.o FAILED: mctp.p/src_mctp-ops.c.o x86_64-linux-musl-gcc -Imctp.p -I. -I.. -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -O0 -g -Wno-unused-parameter -MD -MQ mctp.p/src_mctp-ops.c.o -MF mctp.p/src_mctp-ops.c.o.d -o mctp.p/src_mctp-ops.c.o -c ../src/mctp-ops.c ../src/mctp-ops.c: In function ‘mctp_op_mctp_socket’: ../src/mctp-ops.c:18:23: error: ‘AF_MCTP’ undeclared (first use in this function) 18 | return socket(AF_MCTP, SOCK_DGRAM, 0); | ^~~~~~~ ../src/mctp-ops.c:18:23: note: each undeclared identifier is reported only once for each function it appears in ../src/mctp-ops.c:19:1: warning: control reaches end of non-void function [-Wreturn-type] 19 | } | ^ We need mctp.h for either linux/socket.h, or the fallback definitions. Reported-by: Chanh Nguyen Signed-off-by: Jeremy Kerr --- src/mctp-ops.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mctp-ops.c b/src/mctp-ops.c index bfb491d..b5536e4 100644 --- a/src/mctp-ops.c +++ b/src/mctp-ops.c @@ -10,6 +10,7 @@ #include #include +#include "mctp.h" #include "mctp-ops.h" static int mctp_op_mctp_socket(void)