[glibc/release/2.42/master] Linux: Only define OPEN_TREE_* macros in <sys/mount.h> if undefined (bug 33921)
Florian Weimer via Glibc-cvs <[email protected]>
| Newsgroups | gmane.comp.lib.glibc.cvs |
|---|---|
| Message-ID | <[email protected]> |
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=3ecfa68561d723564a1fb565366182eb4acb3e8f commit 3ecfa68561d723564a1fb565366182eb4acb3e8f Author: Florian Weimer <[email protected]> Date: Wed Mar 4 18:32:36 2026 +0100 Linux: Only define OPEN_TREE_* macros in <sys/mount.h> if undefined (bug 33921) There is a conditional inclusion of <linux/mount.h> earlier in the file. If that defines the macros, do not redefine them. This addresses build problems as the token sequence used by the UAPI macro definitions changes between Linux versions. Reviewed-by: Adhemerval Zanella <[email protected]> (cherry picked from commit d12b017cddfeb9fe9920ba054ae3dfcb8e9238b8) Diff: --- sysdeps/unix/sysv/linux/sys/mount.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sysdeps/unix/sysv/linux/sys/mount.h b/sysdeps/unix/sysv/linux/sys/mount.h index 365da1c296..30ba56c1e8 100644 --- a/sysdeps/unix/sysv/linux/sys/mount.h +++ b/sysdeps/unix/sysv/linux/sys/mount.h @@ -264,14 +264,16 @@ enum fsconfig_command #define FSOPEN_CLOEXEC 0x00000001 /* open_tree flags. */ -#define OPEN_TREE_CLONE 1 /* Clone the target tree and attach the clone */ +#ifndef OPEN_TREE_CLONE +# define OPEN_TREE_CLONE 1 /* Clone the target tree and attach the clone */ +#endif #ifndef O_CLOEXEC # include <bits/cloexec.h> # define O_CLOEXEC __O_CLOEXEC #endif -#undef OPEN_TREE_CLOEXEC -#define OPEN_TREE_CLOEXEC O_CLOEXEC /* Close the file on execve() */ - +#ifndef OPEN_TREE_CLOEXEC +# define OPEN_TREE_CLOEXEC O_CLOEXEC /* Close the file on execve() */ +#endif __BEGIN_DECLS