Skip to content

Commit

Permalink
mctp-ops: Include mctp.h for AF_MCTP definition
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Jeremy Kerr <[email protected]>
  • Loading branch information
jk-ozlabs committed Oct 18, 2024
1 parent 9986862 commit 0629ec8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/mctp-ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <unistd.h>
#include <linux/netlink.h>

#include "mctp.h"
#include "mctp-ops.h"

static int mctp_op_mctp_socket(void)
Expand Down

0 comments on commit 0629ec8

Please sign in to comment.