summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac2
-rw-r--r--openbsd-compat/bsd-statvfs.c10
2 files changed, 9 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 268fe1a4b..ea99887fd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3751,7 +3751,7 @@ AC_CHECK_TYPES([fsblkcnt_t, fsfilcnt_t], , , [
3751#endif 3751#endif
3752]) 3752])
3753 3753
3754AC_CHECK_MEMBERS([struct statfs.f_flags], [], [], [[ 3754AC_CHECK_MEMBERS([struct statfs.f_files, struct statfs.f_flags], [], [], [[
3755#include <sys/types.h> 3755#include <sys/types.h>
3756#ifdef HAVE_SYS_BITYPES_H 3756#ifdef HAVE_SYS_BITYPES_H
3757#include <sys/bitypes.h> 3757#include <sys/bitypes.h>
diff --git a/openbsd-compat/bsd-statvfs.c b/openbsd-compat/bsd-statvfs.c
index e3bd87d98..10d876439 100644
--- a/openbsd-compat/bsd-statvfs.c
+++ b/openbsd-compat/bsd-statvfs.c
@@ -29,6 +29,11 @@
29# define MNAMELEN 32 29# define MNAMELEN 32
30#endif 30#endif
31 31
32#ifdef HAVE_STRUCT_STATFS_F_FILES
33# define HAVE_STRUCT_STATFS
34#endif
35
36#ifdef HAVE_STRUCT_STATFS
32static void 37static void
33copy_statfs_to_statvfs(struct statvfs *to, struct statfs *from) 38copy_statfs_to_statvfs(struct statvfs *to, struct statfs *from)
34{ 39{
@@ -48,11 +53,12 @@ copy_statfs_to_statvfs(struct statvfs *to, struct statfs *from)
48#endif 53#endif
49 to->f_namemax = MNAMELEN; 54 to->f_namemax = MNAMELEN;
50} 55}
56#endif
51 57
52# ifndef HAVE_STATVFS 58# ifndef HAVE_STATVFS
53int statvfs(const char *path, struct statvfs *buf) 59int statvfs(const char *path, struct statvfs *buf)
54{ 60{
55# ifdef HAVE_STATFS 61# if defined(HAVE_STATFS) && defined(HAVE_STRUCT_STATFS)
56 struct statfs fs; 62 struct statfs fs;
57 63
58 memset(&fs, 0, sizeof(fs)); 64 memset(&fs, 0, sizeof(fs));
@@ -70,7 +76,7 @@ int statvfs(const char *path, struct statvfs *buf)
70# ifndef HAVE_FSTATVFS 76# ifndef HAVE_FSTATVFS
71int fstatvfs(int fd, struct statvfs *buf) 77int fstatvfs(int fd, struct statvfs *buf)
72{ 78{
73# ifdef HAVE_FSTATFS 79# if defined(HAVE_FSTATFS) && defined(HAVE_STRUCT_STATFS)
74 struct statfs fs; 80 struct statfs fs;
75 81
76 memset(&fs, 0, sizeof(fs)); 82 memset(&fs, 0, sizeof(fs));