Message ID | 87a684ejbj.fsf@oldenburg.str.redhat.com |
---|---|
State | New |
Headers | show |
Series | Linux: Fix enum fsconfig_command detection in <sys/mount.h> | expand |
On Aug 16 2022, Florian Weimer via Libc-alpha wrote: > The #ifdef FSOPEN_CLOEXEC check did not work because the macro > was defined prior to its use. This is confusing, since generally we want macros to be defined before their use. What's important here is that the use is about checking for absence of the macro in the kernel header.
* Andreas Schwab: > On Aug 16 2022, Florian Weimer via Libc-alpha wrote: > >> The #ifdef FSOPEN_CLOEXEC check did not work because the macro >> was defined prior to its use. > > This is confusing, since generally we want macros to be defined before > their use. What's important here is that the use is about checking for > absence of the macro in the kernel header. Do you suggest to reword the commit message? What about this? “ The #ifdef FSOPEN_CLOEXEC check did not work because the macro was always defined in this header prior to the check, so that the <linux/mount.h> contents did not matter. ” Thanks, Florian
On Aug 16 2022, Florian Weimer wrote: > “ > The #ifdef FSOPEN_CLOEXEC check did not work because the macro > was always defined in this header prior to the check, so that > the <linux/mount.h> contents did not matter. > ” WFM.
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() */