]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
include/statfs_magic.h: avoid sys/mount.h and linux/fs.h collision
authorKarel Zak <kzak@redhat.com>
Tue, 7 Apr 2026 13:34:13 +0000 (15:34 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 7 Apr 2026 13:34:13 +0000 (15:34 +0200)
Guard the sys/mount.h include with !defined(MS_RDONLY) to prevent
redefinition errors when linux/fs.h has already been included (e.g.,
in fstrim.c). This follows the same pattern used in libmount.h.in.

Fixes: 1af964d935 ("include/statfs_magic.h: add portable struct statfs headers for Darwin")
Signed-off-by: Karel Zak <kzak@redhat.com>
include/statfs_magic.h

index 28977f39293d68b24aa7485fa845fa7339d0cebd..a73bdb926cf74c373c93a32e96e4d1ee31a728c1 100644 (file)
@@ -21,7 +21,7 @@
 # include <sys/vfs.h>
 #endif
 
-#ifdef HAVE_SYS_MOUNT_H
+#if defined(HAVE_SYS_MOUNT_H) && !defined(MS_RDONLY)
 # include <sys/mount.h>
 #endif