devlink: fix build with musl libc
Subsystems (2)
cover devlink: fix build with musl libc
I was unable to compile the devlink tool with musl libc. It seems like the signal.h header should be included.
Cheers,
- Dan
Dan Robertson (1):
devlink: fix build with musl libc
devlink/devlink.c | 1 + 1 file changed, 1 insertion(+)
PATCH 1/1 devlink: fix build with musl libc
The devlink tool makes use of the sigaction function and structure, but does not include the signal.h header. This causes builds with musl libc to fail. According to the Open Group specification this header should be included for the sigaction function and structure definition.
--- devlink/devlink.c | 1 + 1 file changed, 1 insertion(+)
devlink/devlink.c +1 -0
@@ -26,6 +26,7 @@#include <libmnl/libmnl.h> #include <netinet/ether.h> #include <sys/types.h> +#include <signal.h> #include "SNAPSHOT.h" #include "list.h"
PATCH 1/1 devlink: update include files
Use the tool iwyu to get more complete list of includes for all the bits used by devlink.
This should also fix build with musl libc.
---
This is more complete version of suggested patch
devlink/devlink.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
devlink/devlink.c +8 -1
@@ -19,18 +19,25 @@#include <limits.h> #include <errno.h> #include <inttypes.h> +#include <signal.h> +#include <time.h> +#include <netinet/in.h> +#include <arpa/inet.h> #include <sys/sysinfo.h> #define _LINUX_SYSINFO_H/* avoid collision with musl header */ #include <linux/genetlink.h> #include <linux/devlink.h> +#include <linux/netlink.h> #include <libmnl/libmnl.h> #include <netinet/ether.h> +#include <sys/select.h> +#include <sys/socket.h> #include <sys/types.h> #include "SNAPSHOT.h" #include "list.h" #include "mnlg.h" -#include "json_writer.h" +#include "json_print.h" #include "utils.h" #include "namespace.h"
Signature · 1 line
2.26.2