summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Deutschmann <whissi@gentoo.org>2018-08-02 20:35:55 +0200
committerThomas Deutschmann <whissi@gentoo.org>2018-08-02 20:40:30 +0200
commitd2742fad0ebcdb912763f84637a3a52b7a13d895 (patch)
tree8a2778391ab5727292d8a619fbba39348fcf770d /app-metrics
parentnet-wireless/kismet: beta wooooooo (diff)
downloadgentoo-d2742fad0ebcdb912763f84637a3a52b7a13d895.tar.gz
gentoo-d2742fad0ebcdb912763f84637a3a52b7a13d895.tar.bz2
gentoo-d2742fad0ebcdb912763f84637a3a52b7a13d895.zip
app-metrics/collectd: fix UDEV usage in disk plugin
Closes: https://bugs.gentoo.org/662488 Package-Manager: Portage-2.3.44, Repoman-2.3.10 RepoMan-Options: --force
Diffstat (limited to 'app-metrics')
-rw-r--r--app-metrics/collectd/collectd-5.8.0-r1.ebuild (renamed from app-metrics/collectd/collectd-5.8.0.ebuild)2
-rw-r--r--app-metrics/collectd/files/collectd-5.8.0-disk-plugin-udev-fix.patch98
2 files changed, 100 insertions, 0 deletions
diff --git a/app-metrics/collectd/collectd-5.8.0.ebuild b/app-metrics/collectd/collectd-5.8.0-r1.ebuild
index 65229f538d9e..a401e6d8c24b 100644
--- a/app-metrics/collectd/collectd-5.8.0.ebuild
+++ b/app-metrics/collectd/collectd-5.8.0-r1.ebuild
@@ -159,6 +159,8 @@ REQUIRED_USE="
collectd_plugins_python? ( ${PYTHON_REQUIRED_USE} )
collectd_plugins_smart? ( udev )"
+PATCHES=( "${FILESDIR}"/${P}-disk-plugin-udev-fix.patch )
+
# @FUNCTION: collectd_plugin_kernel_linux
# @DESCRIPTION:
# USAGE: <plugin name> <kernel_options> <severity>
diff --git a/app-metrics/collectd/files/collectd-5.8.0-disk-plugin-udev-fix.patch b/app-metrics/collectd/files/collectd-5.8.0-disk-plugin-udev-fix.patch
new file mode 100644
index 000000000000..1a96f06df0a8
--- /dev/null
+++ b/app-metrics/collectd/files/collectd-5.8.0-disk-plugin-udev-fix.patch
@@ -0,0 +1,98 @@
+From ed696c1b3adcb42d55759efe6f8034337f0fd243 Mon Sep 17 00:00:00 2001
+From: Dylan Stephano-Shachter <dylan@wopr.nasuni.net>
+Date: Thu, 15 Feb 2018 16:37:33 -0500
+Subject: [PATCH] change HAVE_UDEV_H to HAVE_LIBUDEV_H for bug 2651
+
+---
+ src/disk.c | 20 ++++++++++----------
+ 1 file changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/src/disk.c b/src/disk.c
+index 004ce9e2d7..04f337415f 100644
+--- a/src/disk.c
++++ b/src/disk.c
+@@ -139,7 +139,7 @@ static int pnumdisk;
+ #error "No applicable input method."
+ #endif
+
+-#if HAVE_UDEV_H
++#if HAVE_LIBUDEV_H
+ #include <libudev.h>
+
+ static char *conf_udev_name_attr = NULL;
+@@ -173,7 +173,7 @@ static int disk_config(const char *key, const char *value) {
+ "on Mach / Mac OS X and will be ignored.");
+ #endif
+ } else if (strcasecmp("UdevNameAttr", key) == 0) {
+-#if HAVE_UDEV_H
++#if HAVE_LIBUDEV_H
+ if (conf_udev_name_attr != NULL) {
+ free(conf_udev_name_attr);
+ conf_udev_name_attr = NULL;
+@@ -209,7 +209,7 @@ static int disk_init(void) {
+ /* #endif HAVE_IOKIT_IOKITLIB_H */
+
+ #elif KERNEL_LINUX
+-#if HAVE_UDEV_H
++#if HAVE_LIBUDEV_H
+ if (conf_udev_name_attr != NULL) {
+ handle_udev = udev_new();
+ if (handle_udev == NULL) {
+@@ -217,7 +217,7 @@ static int disk_init(void) {
+ return -1;
+ }
+ }
+-#endif /* HAVE_UDEV_H */
++#endif /* HAVE_LIBUDEV_H */
+ /* #endif KERNEL_LINUX */
+
+ #elif KERNEL_FREEBSD
+@@ -260,10 +260,10 @@ static int disk_init(void) {
+
+ static int disk_shutdown(void) {
+ #if KERNEL_LINUX
+-#if HAVE_UDEV_H
++#if HAVE_LIBUDEV_H
+ if (handle_udev != NULL)
+ udev_unref(handle_udev);
+-#endif /* HAVE_UDEV_H */
++#endif /* HAVE_LIBUDEV_H */
+ #endif /* KERNEL_LINUX */
+ return 0;
+ } /* int disk_shutdown */
+@@ -325,7 +325,7 @@ static counter_t disk_calc_time_incr(counter_t delta_time,
+ }
+ #endif
+
+-#if HAVE_UDEV_H
++#if HAVE_LIBUDEV_H
+ /**
+ * Attempt to provide an rename disk instance from an assigned udev attribute.
+ *
+@@ -841,7 +841,7 @@ static int disk_read(void) {
+
+ output_name = disk_name;
+
+-#if HAVE_UDEV_H
++#if HAVE_LIBUDEV_H
+ char *alt_name = NULL;
+ if (conf_udev_name_attr != NULL) {
+ alt_name =
+@@ -852,7 +852,7 @@ static int disk_read(void) {
+ #endif
+
+ if (ignorelist_match(ignorelist, output_name) != 0) {
+-#if HAVE_UDEV_H
++#if HAVE_LIBUDEV_H
+ /* release udev-based alternate name, if allocated */
+ sfree(alt_name);
+ #endif
+@@ -878,7 +878,7 @@ static int disk_read(void) {
+ submit_io_time(output_name, io_time, weighted_time);
+ } /* if (is_disk) */
+
+-#if HAVE_UDEV_H
++#if HAVE_LIBUDEV_H
+ /* release udev-based alternate name, if allocated */
+ sfree(alt_name);
+ #endif