summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2018-03-26 17:34:53 +0200
committerLuke Shumaker <lukeshu@parabola.nu>2018-07-26 22:08:13 -0400
commitd559e0e3b144c280924e4ac838830234c226acf9 (patch)
treee86f75503137976bdc748662bd3737e4cab225ce
parent82658ad1020ed8a60a3af02a4ffdb1a1e8aff1a2 (diff)
core: don't include libmount.h in a header file (#8580)notsystemd/sd-v232-stable
linux/fs.h sys/mount.h, libmount.h and missing.h all include MS_* definitions. To avoid problems, only one of linux/fs.h, sys/mount.h and libmount.h should be included. And missing.h must be included last. Without this, building systemd may fail with: In file included from [...]/libmount/libmount.h:31:0, from ../systemd-238/src/core/manager.h:23, from ../systemd-238/src/core/emergency-action.h:37, from ../systemd-238/src/core/unit.h:34, from ../systemd-238/src/core/dbus-timer.h:25, from ../systemd-238/src/core/timer.c:26: [...]/sys/mount.h:57:2: error: expected identifier before numeric constant (cherry picked from commit 227b8a762fea1458547be2cdf0e6e4aac0079730)
-rw-r--r--src/core/dbus-execute.c1
-rw-r--r--src/core/manager.h3
-rw-r--r--src/core/mount.c2
3 files changed, 5 insertions, 1 deletions
diff --git a/src/core/dbus-execute.c b/src/core/dbus-execute.c
index 1a7f770db1..f34cc3dbe5 100644
--- a/src/core/dbus-execute.c
+++ b/src/core/dbus-execute.c
@@ -17,6 +17,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <sys/mount.h>
#include <sys/prctl.h>
#ifdef HAVE_SECCOMP
diff --git a/src/core/manager.h b/src/core/manager.h
index 35172fdba9..19a6773cc6 100644
--- a/src/core/manager.h
+++ b/src/core/manager.h
@@ -19,7 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <libmount.h>
#include <stdbool.h>
#include <stdio.h>
@@ -32,6 +31,8 @@
#include "list.h"
#include "ratelimit.h"
+struct libmnt_monitor;
+
/* Enforce upper limit how many names we allow */
#define MANAGER_MAX_NAMES 131072 /* 128K */
diff --git a/src/core/mount.c b/src/core/mount.c
index d749e49df5..105eb4e97b 100644
--- a/src/core/mount.c
+++ b/src/core/mount.c
@@ -22,6 +22,8 @@
#include <stdio.h>
#include <sys/epoll.h>
+#include <libmount.h>
+
#include "sd-messages.h"
#include "alloc-util.h"