You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/app-admin/collectd/files/collectd-5.5.1-issue-1637.p...

69 lines
1.9 KiB

From 7630585ca596af6334f89db26272d80f4ef02a8a Mon Sep 17 00:00:00 2001
From: Ruben Kerkhof <ruben@rubenkerkhof.com>
Date: Sat, 26 Mar 2016 18:18:44 +0100
Subject: [PATCH 4/4] Fix building with xfsprogs 4.5.0
commit 865a6c83250e3d4381596a0d937df31d563f97c6 upstream.
xfsprogs 4.5.0 started to use off64_t in its headers,
which is hidden behind _GNU_SOURCE
Fixes #1637
---
configure.ac | 7 ++++++-
src/utils_mount.c | 13 ++++++++-----
2 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/configure.ac b/configure.ac
index 129b9d4..a2058d0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -593,7 +593,12 @@ AC_CHECK_HEADERS(linux/un.h, [], [],
#endif
])
-AC_CHECK_HEADERS(pwd.h grp.h sys/un.h ctype.h limits.h xfs/xqm.h fs_info.h fshelp.h paths.h mntent.h mnttab.h sys/fstyp.h sys/fs_types.h sys/mntent.h sys/mnttab.h sys/statfs.h sys/statvfs.h sys/vfs.h sys/vfstab.h sys/vmmeter.h kvm.h wordexp.h locale.h)
+AC_CHECK_HEADERS(pwd.h grp.h sys/un.h ctype.h limits.h fs_info.h fshelp.h paths.h mntent.h mnttab.h sys/fstyp.h sys/fs_types.h sys/mntent.h sys/mnttab.h sys/statfs.h sys/statvfs.h sys/vfs.h sys/vfstab.h sys/vmmeter.h kvm.h wordexp.h locale.h)
+
+AC_CHECK_HEADERS([xfs/xqm.h], [], [],
+[
+#define _GNU_SOURCE
+])
# For the dns plugin
AC_CHECK_HEADERS(arpa/nameser.h)
diff --git a/src/utils_mount.c b/src/utils_mount.c
index f2b7943..cf5e97a 100644
--- a/src/utils_mount.c
+++ b/src/utils_mount.c
@@ -21,18 +21,21 @@
* Niki W. Waibel <niki.waibel@gmx.net>
**/
-#include "collectd.h"
-#include "utils_mount.h"
-
-#include "common.h" /* sstrncpy() et alii */
-#include "plugin.h" /* ERROR() macro */
+#if HAVE_CONFIG_H
+# include "config.h"
+#endif
#if HAVE_XFS_XQM_H
+# define _GNU_SOURCE
# include <xfs/xqm.h>
#define XFS_SUPER_MAGIC_STR "XFSB"
#define XFS_SUPER_MAGIC2_STR "BSFX"
#endif
+#include "common.h"
+#include "plugin.h"
+#include "utils_mount.h"
+
#if HAVE_GETVFSSTAT
# if HAVE_SYS_TYPES_H
# include <sys/types.h>
--
2.7.4