public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Linux: Fix enum fsconfig_command detection in <sys/mount.h>
@ 2022-08-16  7:30 Florian Weimer
  2022-08-16  9:44 ` Andreas Schwab
  0 siblings, 1 reply; 4+ messages in thread
From: Florian Weimer @ 2022-08-16  7:30 UTC (permalink / raw)
  To: libc-alpha

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() */


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Linux: Fix enum fsconfig_command detection in <sys/mount.h>
  2022-08-16  7:30 [PATCH] Linux: Fix enum fsconfig_command detection in <sys/mount.h> Florian Weimer
@ 2022-08-16  9:44 ` Andreas Schwab
  2022-08-16  9:51   ` Florian Weimer
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Schwab @ 2022-08-16  9:44 UTC (permalink / raw)
  To: Florian Weimer via Libc-alpha; +Cc: Florian Weimer

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, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Linux: Fix enum fsconfig_command detection in <sys/mount.h>
  2022-08-16  9:44 ` Andreas Schwab
@ 2022-08-16  9:51   ` Florian Weimer
  2022-08-16 10:00     ` Andreas Schwab
  0 siblings, 1 reply; 4+ messages in thread
From: Florian Weimer @ 2022-08-16  9:51 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Florian Weimer via Libc-alpha

* 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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Linux: Fix enum fsconfig_command detection in <sys/mount.h>
  2022-08-16  9:51   ` Florian Weimer
@ 2022-08-16 10:00     ` Andreas Schwab
  0 siblings, 0 replies; 4+ messages in thread
From: Andreas Schwab @ 2022-08-16 10:00 UTC (permalink / raw)
  To: Florian Weimer; +Cc: Florian Weimer via Libc-alpha

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.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-08-16 10:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-16  7:30 [PATCH] Linux: Fix enum fsconfig_command detection in <sys/mount.h> Florian Weimer
2022-08-16  9:44 ` Andreas Schwab
2022-08-16  9:51   ` Florian Weimer
2022-08-16 10:00     ` Andreas Schwab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).