]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
NetBSD provides a statfs symbol for binary compatibility but does not
authorChristos Zoulas <christos@zoulas.com>
Sat, 8 May 2021 20:06:11 +0000 (16:06 -0400)
committerChristos Zoulas <christos@zoulas.com>
Sat, 8 May 2021 20:06:11 +0000 (16:06 -0400)
provide a visible struct statfs. Check for that.

configure.ac
libarchive/archive_read_disk_posix.c

index 201185dfdb81c88732115d6e105cf3bf60a7940a..2c3838efaf8a9a6a673bde9a30829aaf23c96897 100644 (file)
@@ -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(
index f93c65255d1de7e9b64495161f5d8b1af942c500..3ee6269ff3ce6cb64b7850a1ed27d91037c6e3ba 100644 (file)
@@ -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.