public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/1] lapi/fsmount: Further fix header conflict on old distros
@ 2024-01-17 19:54 Petr Vorel
  2024-01-17 20:51 ` Petr Vorel
  0 siblings, 1 reply; 2+ messages in thread
From: Petr Vorel @ 2024-01-17 19:54 UTC (permalink / raw)
  To: ltp

12867c0d6 fix on lapi/io_uring was not enough.  glibc doc [1] mentions
conflict between <linux/mount.h> and <sys/mount.h>. Because <linux/fs.h>
includes <linux/mount.h> it's easy to get <linux/mount.h> mounted
indirectly.

Problem was fixed on glibc 2.37:
774058d729 ("linux: Fix sys/mount.h usage with kernel headers")
and it got backported to git tree for 2.36 and to some distros.
But it still fails for older glibc.

Therefore include <sys/mount.h> only if <linux/mount.h> not already
included.

[1] https://sourceware.org/glibc/wiki/Synchronizing_Headers
Fixes: #1121
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
CI: https://github.com/pevik/ltp/actions/runs/7561031650

 include/lapi/fsmount.h | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/include/lapi/fsmount.h b/include/lapi/fsmount.h
index 07eb42ffa..2ed4da86f 100644
--- a/include/lapi/fsmount.h
+++ b/include/lapi/fsmount.h
@@ -11,12 +11,11 @@
 #include "config.h"
 #include <sys/syscall.h>
 #include <sys/types.h>
-#include <sys/mount.h>
 
-#ifndef HAVE_FSOPEN
-# ifdef HAVE_LINUX_MOUNT_H
-#  include <linux/mount.h>
-# endif
+#if !defined(HAVE_FSOPEN) && defined(HAVE_LINUX_MOUNT_H)
+# include <linux/mount.h>
+#else
+# include <sys/mount.h>
 #endif
 
 #include "lapi/fcntl.h"
-- 
2.43.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

end of thread, other threads:[~2024-01-17 20:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-17 19:54 [LTP] [PATCH 1/1] lapi/fsmount: Further fix header conflict on old distros Petr Vorel
2024-01-17 20:51 ` Petr Vorel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox