From f8882839103442787c49b8021cfd8ae2784211ad Mon Sep 17 00:00:00 2001 From: Rémy Oudompheng Date: Tue, 5 Apr 2011 01:37:09 +0200 Subject: diskspace: add the actually used statfs type in ifdefs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some systems, like FreeBSD might define both statfs and statvfs: however if statvfs exists whereas getmntinfo() uses a statfs struct, the current ifdefs would select the wrong line of code. Signed-off-by: Rémy Oudompheng Signed-off-by: Dan McGee --- acinclude.m4 | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'acinclude.m4') diff --git a/acinclude.m4 b/acinclude.m4 index 7309d731..df4f83a4 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -123,6 +123,13 @@ extern int getmntinfo (struct statfs **, int); ) AC_DEFINE_UNQUOTED(FSSTATSTYPE, [$fs_stats_cv_type], [Defined as the filesystem stats type ('statvfs' or 'statfs')]) + if test $ac_cv_func_getmntinfo = yes; then + if test "$fs_stats_cv_type" = "struct statvfs"; then + AC_DEFINE([HAVE_GETMNTINFO_STATVFS], 1, [Define if getmntinfo() uses statvfs.]) + else + AC_DEFINE([HAVE_GETMNTINFO_STATFS], 1, [Define if getmntinfo() uses statfs.]) + fi + fi ]) dnl Checks for PATH_MAX and defines it if not present -- cgit v1.2.3-54-g00ecf