summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRudi Heitbaum <rudi@heitbaum.com>2022-07-23 10:38:49 +0000
committerLukasz Stelmach <l.stelmach@samsung.com>2022-12-09 15:15:25 +0000
commitcbe32a421ea3b2b678fead8fcda3dc8a5c41a96c (patch)
tree05a8198bc10e1fed8446daccbe21151be8ad8be6
parente9e39051ddd81955839f84eb8910c314ac09c34c (diff)
downloadsystemd-cbe32a421ea3b2b678fead8fcda3dc8a5c41a96c.tar.gz
systemd-cbe32a421ea3b2b678fead8fcda3dc8a5c41a96c.tar.bz2
systemd-cbe32a421ea3b2b678fead8fcda3dc8a5c41a96c.zip
glibc: Remove #include <linux/fs.h> to resolve fsconfig_command/mount_attr conflict with glibc 2.36
Origin: https://github.com/systemd/systemd/commit/3657d3a01c7e25ff86d7a4642065b367c4ff7484 Change-Id: I88e5ea15729c2d65638b5eb208d7c2c800010f13 Signed-off-by: Marek PikuĊ‚a <m.pikula@partner.samsung.com>
-rw-r--r--meson.build13
-rw-r--r--src/core/namespace.c2
2 files changed, 15 insertions, 0 deletions
diff --git a/meson.build b/meson.build
index 4a5f782495..f22003851b 100644
--- a/meson.build
+++ b/meson.build
@@ -464,12 +464,24 @@ decl_headers = '''
foreach decl : ['char16_t',
'char32_t',
+ 'struct mount_attr',
'struct statx',
]
# We get -1 if the size cannot be determined
have = cc.sizeof(decl, prefix : decl_headers, args : '-D_GNU_SOURCE') > 0
+ if decl == 'struct mount_attr'
+ if have
+ want_linux_fs_h = false
+ else
+ have = cc.sizeof(decl,
+ prefix : decl_headers + '#include <linux/fs.h>',
+ args : '-D_GNU_SOURCE') > 0
+ want_linux_fs_h = have
+ endif
+ endif
+
if decl == 'struct statx'
if have
want_linux_stat_h = false
@@ -485,6 +497,7 @@ foreach decl : ['char16_t',
endforeach
conf.set10('WANT_LINUX_STAT_H', want_linux_stat_h)
+conf.set10('WANT_LINUX_FS_H', want_linux_fs_h)
foreach ident : ['secure_getenv', '__secure_getenv']
conf.set10('HAVE_' + ident.to_upper(), cc.has_function(ident))
diff --git a/src/core/namespace.c b/src/core/namespace.c
index bbb372459b..5ecf1cbfff 100644
--- a/src/core/namespace.c
+++ b/src/core/namespace.c
@@ -5,7 +5,9 @@
#include <stdio.h>
#include <sys/mount.h>
#include <unistd.h>
+#if WANT_LINUX_FS_H
#include <linux/fs.h>
+#endif
#include "alloc-util.h"
#include "base-filesystem.h"