]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: don't include libmount.h in a header file (#8580)
authorMichael Olbrich <m.olbrich@pengutronix.de>
Mon, 26 Mar 2018 15:34:53 +0000 (17:34 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 26 Mar 2018 15:34:53 +0000 (17:34 +0200)
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

src/core/dbus-execute.c
src/core/manager.h
src/core/mount.c

index 7344623ebf694cea59589559d57b42fe9e6127f1..c342093bca45d209c56e9e18c25d397122b6ac24 100644 (file)
@@ -18,6 +18,7 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include <sys/mount.h>
 #include <sys/prctl.h>
 #include <stdio_ext.h>
 
index 28c5da225b16e624e6596ad38f96a90134425f25..e09e0cdf5e9e7685e93df08a7899605061615510 100644 (file)
@@ -20,7 +20,6 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <libmount.h>
 #include <stdbool.h>
 #include <stdio.h>
 
@@ -34,6 +33,8 @@
 #include "list.h"
 #include "ratelimit.h"
 
+struct libmnt_monitor;
+
 /* Enforce upper limit how many names we allow */
 #define MANAGER_MAX_NAMES 131072 /* 128K */
 
index 0e755da5c0234bfa81cb54c84881c1608cb5df11..0154ebda5d611f5758701164482d4a1761d4dadf 100644 (file)
@@ -23,6 +23,8 @@
 #include <stdio.h>
 #include <sys/epoll.h>
 
+#include <libmount.h>
+
 #include "sd-messages.h"
 
 #include "alloc-util.h"