From: Christos Zoulas Date: Sat, 8 May 2021 20:06:11 +0000 (-0400) Subject: NetBSD provides a statfs symbol for binary compatibility but does not X-Git-Tag: v3.5.2~19^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c4970dcd9de656a9cd351b97f74e6dd7f8a6a22c;p=thirdparty%2Flibarchive.git NetBSD provides a statfs symbol for binary compatibility but does not provide a visible struct statfs. Check for that. --- diff --git a/configure.ac b/configure.ac index 201185dfd..2c3838efa 100644 --- a/configure.ac +++ b/configure.ac @@ -685,6 +685,13 @@ AC_CHECK_TYPES(struct xvfsconf,,, #include ]) +AC_CHECK_TYPES(struct statfs,,, + [#if HAVE_SYS_TYPES_H + #include + #endif + #include + ]) + # 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 f93c65255..3ee6269ff 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.