[PATCH] Linux: Fix enum fsconfig_command detection in <sys/mount.h>

Florian Weimer fweimer@redhat.com
Tue Aug 16 07:30:56 GMT 2022


The #ifdef FSOPEN_CLOEXEC check did not work because the macro
was defined prior to its use.  This caused misc/tst-mount to fail
to build with older kernel headers.

Fixes commit 774058d72942249f71d74e7f2b639f77184160a6
("linux: Fix sys/mount.h usage with kernel headers").

Tesed on power64-linux-gnu.

---
 sysdeps/unix/sysv/linux/sys/mount.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sysdeps/unix/sysv/linux/sys/mount.h b/sysdeps/unix/sysv/linux/sys/mount.h
index 2e3fd6a7fe..19841d0738 100644
--- a/sysdeps/unix/sysv/linux/sys/mount.h
+++ b/sysdeps/unix/sysv/linux/sys/mount.h
@@ -188,9 +188,6 @@ enum
 };
 
 
-/* fsopen flags.  */
-#define FSOPEN_CLOEXEC          0x00000001
-
 /* fsmount flags.  */
 #define FSMOUNT_CLOEXEC         0x00000001
 
@@ -261,6 +258,9 @@ enum fsconfig_command
 };
 #endif
 
+/* fsopen flags.  */
+#define FSOPEN_CLOEXEC          0x00000001
+
 /* open_tree flags.  */
 #define OPEN_TREE_CLONE    1         /* Clone the target tree and attach the clone */
 #define OPEN_TREE_CLOEXEC  O_CLOEXEC /* Close the file on execve() */



More information about the Libc-alpha mailing list