glibc: Remove #include <linux/fs.h> to resolve fsconfig_command/mount_attr conflict... 38/285138/4
authorRudi Heitbaum <rudi@heitbaum.com>
Sat, 23 Jul 2022 10:38:49 +0000 (10:38 +0000)
committerLukasz Stelmach <l.stelmach@samsung.com>
Fri, 9 Dec 2022 15:15:25 +0000 (15:15 +0000)
Origin: https://github.com/systemd/systemd/commit/3657d3a01c7e25ff86d7a4642065b367c4ff7484
Change-Id: I88e5ea15729c2d65638b5eb208d7c2c800010f13
Signed-off-by: Marek PikuĊ‚a <m.pikula@partner.samsung.com>
meson.build
src/core/namespace.c

index 4a5f782..f220038 100644 (file)
@@ -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))
index bbb3724..5ecf1cb 100644 (file)
@@ -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"