From 1bb6ba08b128d62acdbbc566d60a054ff5bb9565 Mon Sep 17 00:00:00 2001 From: Rudi Heitbaum Date: Tue, 31 Jan 2023 12:06:56 +0000 Subject: [PATCH] glibc: Conditionally #include to resolve fsconfig_command/mount_attr conflict with glibc 2.36 Co-authored-by: Frantisek Sumsal --- src/basic/linux/README | 1 + src/basic/linux/btrfs.h | 2 ++ src/basic/linux/update.sh | 1 + 3 files changed, 4 insertions(+) diff --git a/src/basic/linux/README b/src/basic/linux/README index 1abc9450a6..790b4feb0a 100644 --- a/src/basic/linux/README +++ b/src/basic/linux/README @@ -5,3 +5,4 @@ modifications are applied: - btrfs.h: drop '__user' attributes - if.h: drop '#include ' and '__user' attributes - stddef.h: drop '#include ' +- guard linux/fs.h include to avoid conflict with glibc 2.36 diff --git a/src/basic/linux/btrfs.h b/src/basic/linux/btrfs.h index 0a53bdc38a..74ed9088bd 100644 --- a/src/basic/linux/btrfs.h +++ b/src/basic/linux/btrfs.h @@ -26,7 +26,9 @@ extern "C" { #include #include +#if WANT_LINUX_FS_H #include +#endif #define BTRFS_IOCTL_MAGIC 0x94 #define BTRFS_VOL_NAME_MAX 255 diff --git a/src/basic/linux/update.sh b/src/basic/linux/update.sh index 6aff039d3e..6155766aaf 100755 --- a/src/basic/linux/update.sh +++ b/src/basic/linux/update.sh @@ -7,4 +7,5 @@ for i in *.h */*.h; do curl --fail "https://raw.githubusercontent.com/torvalds/linux/master/include/uapi/linux/$i" -o "$i" sed -r -i -e 's/__user //g' -e '/^#include / d' "$i" + sed -r -i 's/^(#include )/#if WANT_LINUX_FS_H\n\1\n#endif/' "$i" done