public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] linux: Fix sys/mount.h usage of FSOPEN_CLOEXEC
@ 2022-08-25  6:49 Radostin Stoyanov
  2022-08-25  8:03 ` Florian Weimer
  0 siblings, 1 reply; 2+ messages in thread
From: Radostin Stoyanov @ 2022-08-25  6:49 UTC (permalink / raw)
  To: libc-alpha; +Cc: Radostin Stoyanov

In commit 774058d72942249f71d74e7f2b639f77184160a6 was introduced
ifndef FSOPEN_CLOEXEC condition surrounding fsconfig_command.
However, the compilation would fail when there are multiple
`define FSOPEN_CLOEXEC`. This patch moves the #endif for
`#ifndef FSOPEN_CLOEXEC` after `#define FSOPEN_CLOEXEC`.

Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
---
 sysdeps/unix/sysv/linux/sys/mount.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sysdeps/unix/sysv/linux/sys/mount.h b/sysdeps/unix/sysv/linux/sys/mount.h
index 19841d0738..92476ba2e7 100644
--- a/sysdeps/unix/sysv/linux/sys/mount.h
+++ b/sysdeps/unix/sysv/linux/sys/mount.h
@@ -256,11 +256,12 @@ enum fsconfig_command
   FSCONFIG_CMD_RECONFIGURE = 7,   /* Invoke superblock reconfiguration */
 # define FSCONFIG_CMD_RECONFIGURE FSCONFIG_CMD_RECONFIGURE
 };
-#endif
 
 /* fsopen flags.  */
 #define FSOPEN_CLOEXEC          0x00000001
 
+#endif
+
 /* 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() */
-- 
2.37.2


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

* Re: [PATCH] linux: Fix sys/mount.h usage of FSOPEN_CLOEXEC
  2022-08-25  6:49 [PATCH] linux: Fix sys/mount.h usage of FSOPEN_CLOEXEC Radostin Stoyanov
@ 2022-08-25  8:03 ` Florian Weimer
  0 siblings, 0 replies; 2+ messages in thread
From: Florian Weimer @ 2022-08-25  8:03 UTC (permalink / raw)
  To: Radostin Stoyanov; +Cc: libc-alpha

* Radostin Stoyanov:

> In commit 774058d72942249f71d74e7f2b639f77184160a6 was introduced
> ifndef FSOPEN_CLOEXEC condition surrounding fsconfig_command.
> However, the compilation would fail when there are multiple
> `define FSOPEN_CLOEXEC`. This patch moves the #endif for
> `#ifndef FSOPEN_CLOEXEC` after `#define FSOPEN_CLOEXEC`.
>
> Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>

Do you have an example of such a compilation failure?  Redudant
definitions with the same token sequence do not result in warnings.

With the redundant definition, we can check if the kernel value and our
value still match.

Thanks,
Florian


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

end of thread, other threads:[~2022-08-25  8:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-25  6:49 [PATCH] linux: Fix sys/mount.h usage of FSOPEN_CLOEXEC Radostin Stoyanov
2022-08-25  8:03 ` Florian Weimer

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).