libmount.patch 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. Upstream-Status: Backport
  2. Signed-off-by: Ross Burton <ross.burton@intel.com>
  3. From 227b8a762fea1458547be2cdf0e6e4aac0079730 Mon Sep 17 00:00:00 2001
  4. From: Michael Olbrich <m.olbrich@pengutronix.de>
  5. Date: Mon, 26 Mar 2018 17:34:53 +0200
  6. Subject: [PATCH] core: don't include libmount.h in a header file (#8580)
  7. linux/fs.h sys/mount.h, libmount.h and missing.h all include MS_*
  8. definitions.
  9. To avoid problems, only one of linux/fs.h, sys/mount.h and libmount.h
  10. should be included. And missing.h must be included last.
  11. Without this, building systemd may fail with:
  12. In file included from [...]/libmount/libmount.h:31:0,
  13. from ../systemd-238/src/core/manager.h:23,
  14. from ../systemd-238/src/core/emergency-action.h:37,
  15. from ../systemd-238/src/core/unit.h:34,
  16. from ../systemd-238/src/core/dbus-timer.h:25,
  17. from ../systemd-238/src/core/timer.c:26:
  18. [...]/sys/mount.h:57:2: error: expected identifier before numeric constant
  19. ---
  20. src/core/dbus-execute.c | 1 +
  21. src/core/manager.h | 3 ++-
  22. src/core/mount.c | 2 ++
  23. 3 files changed, 5 insertions(+), 1 deletion(-)
  24. diff --git a/src/core/dbus-execute.c b/src/core/dbus-execute.c
  25. index 7344623ebf6..c342093bca4 100644
  26. --- a/src/core/dbus-execute.c
  27. +++ b/src/core/dbus-execute.c
  28. @@ -18,6 +18,7 @@
  29. along with systemd; If not, see <http://www.gnu.org/licenses/>.
  30. ***/
  31. +#include <sys/mount.h>
  32. #include <sys/prctl.h>
  33. #include <stdio_ext.h>
  34. diff --git a/src/core/manager.h b/src/core/manager.h
  35. index 28c5da225b1..e09e0cdf5e9 100644
  36. --- a/src/core/manager.h
  37. +++ b/src/core/manager.h
  38. @@ -20,7 +20,6 @@
  39. along with systemd; If not, see <http://www.gnu.org/licenses/>.
  40. ***/
  41. -#include <libmount.h>
  42. #include <stdbool.h>
  43. #include <stdio.h>
  44. @@ -34,6 +33,8 @@
  45. #include "list.h"
  46. #include "ratelimit.h"
  47. +struct libmnt_monitor;
  48. +
  49. /* Enforce upper limit how many names we allow */
  50. #define MANAGER_MAX_NAMES 131072 /* 128K */
  51. diff --git a/src/core/mount.c b/src/core/mount.c
  52. index 0e755da5c02..0154ebda5d6 100644
  53. --- a/src/core/mount.c
  54. +++ b/src/core/mount.c
  55. @@ -23,6 +23,8 @@
  56. #include <stdio.h>
  57. #include <sys/epoll.h>
  58. +#include <libmount.h>
  59. +
  60. #include "sd-messages.h"
  61. #include "alloc-util.h"