]>
Commit | Line | Data |
---|---|---|
2fe64477 MT |
1 | From a2f68263a1da5ad227bcb9cd8fa91b93c8b6c99f Mon Sep 17 00:00:00 2001 |
2 | From: Khem Raj <raj.khem@gmail.com> | |
3 | Date: Mon, 25 Jul 2022 10:56:53 -0700 | |
4 | Subject: [PATCH] libarchive: Do not include sys/mount.h when linux/fs.h is present | |
5 | ||
6 | These headers are in conflict and only one is needed by | |
7 | archive_read_disk_posix.c therefore include linux/fs.h if it exists | |
8 | otherwise include sys/mount.h | |
9 | ||
10 | It also helps compiling with glibc 2.36 | |
11 | where sys/mount.h conflicts with linux/mount.h see [1] | |
12 | ||
13 | [1] https://sourceware.org/glibc/wiki/Release/2.36 | |
14 | --- | |
15 | libarchive/archive_read_disk_posix.c | 5 ++--- | |
16 | 1 file changed, 2 insertions(+), 3 deletions(-) | |
17 | ||
18 | diff --git a/libarchive/archive_read_disk_posix.c b/libarchive/archive_read_disk_posix.c | |
19 | index 2b39e672..a96008db 100644 | |
20 | --- a/libarchive/archive_read_disk_posix.c | |
21 | +++ b/libarchive/archive_read_disk_posix.c | |
22 | @@ -34,9 +34,6 @@ __FBSDID("$FreeBSD$"); | |
23 | #ifdef HAVE_SYS_PARAM_H | |
24 | #include <sys/param.h> | |
25 | #endif | |
26 | -#ifdef HAVE_SYS_MOUNT_H | |
27 | -#include <sys/mount.h> | |
28 | -#endif | |
29 | #ifdef HAVE_SYS_STAT_H | |
30 | #include <sys/stat.h> | |
31 | #endif | |
32 | @@ -54,6 +51,8 @@ __FBSDID("$FreeBSD$"); | |
33 | #endif | |
34 | #ifdef HAVE_LINUX_FS_H | |
35 | #include <linux/fs.h> | |
36 | +#elif HAVE_SYS_MOUNT_H | |
37 | +#include <sys/mount.h> | |
38 | #endif | |
39 | /* | |
40 | * Some Linux distributions have both linux/ext2_fs.h and ext2fs/ext2_fs.h. |