[lxc-devel] [lxc/master] lxc/tools/lxc_monitor: include missing <stddef.h>
tpetazzoni on Github
lxc-bot at linuxcontainers.org
Fri Apr 20 10:31:31 UTC 2018
A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 913 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20180420/a9f3b7a5/attachment.bin>
-------------- next part --------------
From 77d407537f57c3fb92787bdda1eeaec7941d344f Mon Sep 17 00:00:00 2001
From: Thomas Petazzoni <thomas.petazzoni at bootlin.com>
Date: Fri, 20 Apr 2018 12:26:33 +0200
Subject: [PATCH] lxc/tools/lxc_monitor: include missing <stddef.h>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
lxc_monitor.c uses offsetof(), so it should include
<stddef.h>. Otherwise the build fails with the musl C library:
tools/lxc_monitor.c: In function ‘lxc_abstract_unix_connect’:
tools/lxc_monitor.c:324:9: warning: implicit declaration of function ‘offsetof’ [-Wimplicit-function-declaration]
offsetof(struct sockaddr_un, sun_path) + len + 1);
^~~~~~~~
tools/lxc_monitor.c:324:18: error: expected expression before ‘struct’
offsetof(struct sockaddr_un, sun_path) + len + 1);
^~~~~~
Signed-off-by: Thomas Petazzoni <thomas.petazzoni at bootlin.com>
---
src/lxc/tools/lxc_monitor.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/lxc/tools/lxc_monitor.c b/src/lxc/tools/lxc_monitor.c
index 72dca8e21..c60e14ff5 100644
--- a/src/lxc/tools/lxc_monitor.c
+++ b/src/lxc/tools/lxc_monitor.c
@@ -30,6 +30,7 @@
#include <libgen.h>
#include <poll.h>
#include <regex.h>
+#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
More information about the lxc-devel
mailing list