summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristos Zoulas <christos@zoulas.com>2021-05-08 16:06:11 -0400
committerChristos Zoulas <christos@zoulas.com>2021-05-08 16:06:11 -0400
commitc4970dcd9de656a9cd351b97f74e6dd7f8a6a22c (patch)
treec5a38317250d52e3a22a80f6e9ea584abc2d90bf
parent38801ec390971d0e1d1a005209f63b02106e073d (diff)
downloadlibarchive-c4970dcd9de656a9cd351b97f74e6dd7f8a6a22c.tar.gz
NetBSD provides a statfs symbol for binary compatibility but does not
provide a visible struct statfs. Check for that.
-rw-r--r--configure.ac7
-rw-r--r--libarchive/archive_read_disk_posix.c6
2 files changed, 10 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 201185df..2c3838ef 100644
--- a/configure.ac
+++ b/configure.ac
@@ -685,6 +685,13 @@ AC_CHECK_TYPES(struct xvfsconf,,,
#include <sys/mount.h>
])
+AC_CHECK_TYPES(struct statfs,,,
+ [#if HAVE_SYS_TYPES_H
+ #include <sys/types.h>
+ #endif
+ #include <sys/mount.h>
+ ])
+
# There are several variants of readdir_r around; we only
# accept the POSIX-compliant version.
AC_COMPILE_IFELSE(
diff --git a/libarchive/archive_read_disk_posix.c b/libarchive/archive_read_disk_posix.c
index f93c6525..3ee6269f 100644
--- a/libarchive/archive_read_disk_posix.c
+++ b/libarchive/archive_read_disk_posix.c
@@ -1538,7 +1538,7 @@ set_statvfs_transfer_size(struct filesystem *fs, const struct statvfs *sfs)
}
#endif
-#if defined(HAVE_STATFS)
+#if defined(HAVE_STRUCT_STATFS)
static inline __LA_UNUSED void
set_statfs_transfer_size(struct filesystem *fs, const struct statfs *sfs)
{
@@ -1554,8 +1554,8 @@ set_statfs_transfer_size(struct filesystem *fs, const struct statfs *sfs)
}
#endif
-#if defined(HAVE_STATFS) && defined(HAVE_FSTATFS) && defined(MNT_LOCAL) \
- && !defined(ST_LOCAL)
+#if defined(HAVE_STRUCT_STATFS) && defined(HAVE_STATFS) && \
+ defined(HAVE_FSTATFS) && defined(MNT_LOCAL) && !defined(ST_LOCAL)
/*
* Gather current filesystem properties on FreeBSD, OpenBSD and Mac OS X.