]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
libarchive: Do not include sys/mount.h when linux/fs.h is present 1761/head
authorKhem Raj <raj.khem@gmail.com>
Mon, 25 Jul 2022 17:56:53 +0000 (10:56 -0700)
committerKhem Raj <raj.khem@gmail.com>
Wed, 27 Jul 2022 01:31:20 +0000 (01:31 +0000)
These headers are in conflict and only one is needed by
archive_read_disk_posix.c therefore include linux/fs.h if it exists
otherwise include sys/mount.h

It also helps compiling with glibc 2.36
where sys/mount.h conflicts with linux/mount.h see [1]

[1] https://sourceware.org/glibc/wiki/Release/2.36

libarchive/archive_read_disk_posix.c

index 2b39e672b49c83bf74457f6e6aff6d2fcc466a43..a96008db7b7982bd106f63f8c5eab1d23d3b5de0 100644 (file)
@@ -34,9 +34,6 @@ __FBSDID("$FreeBSD$");
 #ifdef HAVE_SYS_PARAM_H
 #include <sys/param.h>
 #endif
-#ifdef HAVE_SYS_MOUNT_H
-#include <sys/mount.h>
-#endif
 #ifdef HAVE_SYS_STAT_H
 #include <sys/stat.h>
 #endif
@@ -54,6 +51,8 @@ __FBSDID("$FreeBSD$");
 #endif
 #ifdef HAVE_LINUX_FS_H
 #include <linux/fs.h>
+#elif HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
 #endif
 /*
  * Some Linux distributions have both linux/ext2_fs.h and ext2fs/ext2_fs.h.