From: Ruben Kerkhof Date: Sun, 28 Feb 2016 17:29:41 +0000 (+0100) Subject: Fix build on DragonFlyBSD X-Git-Tag: collectd-5.5.2~6^2~26^2 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=cadd56ca4dd15b17f98f9d606d7054827182205b;p=collectd.git Fix build on DragonFlyBSD DragonFlyBSD has both vfsstat and fsstat apis. It lacks ST_NOWAIT however. The easiest fix is to swap the checks and use getfsstat first. --- diff --git a/src/utils_mount.c b/src/utils_mount.c index 05bc1a14..6555b418 100644 --- a/src/utils_mount.c +++ b/src/utils_mount.c @@ -431,16 +431,16 @@ static cu_mount_t *cu_mount_listmntent (void) #elif HAVE_GETVFSSTAT || HAVE_GETFSSTAT static cu_mount_t *cu_mount_getfsstat (void) { -#if HAVE_GETVFSSTAT -# define STRUCT_STATFS struct statvfs -# define CMD_STATFS getvfsstat -# define FLAGS_STATFS ST_NOWAIT -/* #endif HAVE_GETVFSSTAT */ -#elif HAVE_GETFSSTAT +#if HAVE_GETFSSTAT # define STRUCT_STATFS struct statfs # define CMD_STATFS getfsstat # define FLAGS_STATFS MNT_NOWAIT -#endif /* HAVE_GETFSSTAT */ +/* #endif HAVE_GETFSSTAT */ +#elif HAVE_GETVFSSTAT +# define STRUCT_STATFS struct statvfs +# define CMD_STATFS getvfsstat +# define FLAGS_STATFS ST_NOWAIT +#endif /* HAVE_GETVFSSTAT */ int bufsize; STRUCT_STATFS *buf;