]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
glibc: Remove #include <linux/fs.h> to resolve fsconfig_command/mount_attr conflict...
authorRudi Heitbaum <rudi@heitbaum.com>
Sat, 23 Jul 2022 10:38:49 +0000 (10:38 +0000)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 24 Jul 2022 11:52:35 +0000 (20:52 +0900)
meson.build
src/basic/fd-util.c
src/core/namespace.c
src/shared/mount-util.c

index 61073d4eadb2799f715b46ed856fb7d6908e64ae..4315914a2e0b8d4e28a551562a05ffc8a7003643 100644 (file)
@@ -511,7 +511,6 @@ decl_headers = '''
 #include <uchar.h>
 #include <sys/mount.h>
 #include <sys/stat.h>
-#include <linux/fs.h>
 '''
 
 foreach decl : ['char16_t',
@@ -523,6 +522,17 @@ foreach decl : ['char16_t',
         # 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
@@ -538,6 +548,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 6c1de92a26caa786211cdda45b209d5ed59eb07f..00591d6c2d31fe67805f6c6970100d6698273009 100644 (file)
@@ -3,7 +3,9 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <linux/btrfs.h>
+#if WANT_LINUX_FS_H
 #include <linux/fs.h>
+#endif
 #include <linux/magic.h>
 #include <sys/ioctl.h>
 #include <sys/resource.h>
index 41457ea816474a58f5ff2afee7638cdbaeffd2b9..016afe4d9e90be208935354aa63f0f6b3008967d 100644 (file)
@@ -7,7 +7,9 @@
 #include <sys/file.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"
index 8cf16affcb8f6c6cf479882f1e95c57413aee6c7..a119a7c3c1b2a49bb05713365a3caaaf5db9927f 100644 (file)
@@ -7,7 +7,9 @@
 #include <sys/statvfs.h>
 #include <unistd.h>
 #include <linux/loop.h>
+#if WANT_LINUX_FS_H
 #include <linux/fs.h>
+#endif
 
 #include "alloc-util.h"
 #include "chase-symlinks.h"