From: Sebastian Harl Date: Tue, 2 Jun 2009 19:06:40 +0000 (+0200) Subject: patches: Removed battery_acpi_complain.dpatch. X-Git-Tag: collectd-4.6.3-1~5 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=dcab068e51d8b61928b8c6091106f71c674bd67e;p=pkg-collectd.git patches: Removed battery_acpi_complain.dpatch. This patch has been included upstream. --- diff --git a/debian/changelog b/debian/changelog index 783c344..6a4327b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,12 @@ collectd (4.6.3-1) unstable; urgency=low * New upstream release. + * debian/patches: + - Removed battery_acpi_complain.dpatch - included upstream. * debian/rules: - Install collectd-network.py to /usr/share/doc/collectd/examples/. - -- Sebastian Harl Tue, 02 Jun 2009 20:24:43 +0200 + -- Sebastian Harl Tue, 02 Jun 2009 21:06:02 +0200 collectd (4.6.2-3) unstable; urgency=low diff --git a/debian/patches/00list b/debian/patches/00list index 8a227ab..14eaad5 100644 --- a/debian/patches/00list +++ b/debian/patches/00list @@ -1,6 +1,5 @@ rrd_filter_path.dpatch collection_conf_path.dpatch -battery_acpi_complain.dpatch ntpd_type_pun_fix.dpatch include_empty_files.dpatch rrdtool_uninitialized_fix.dpatch diff --git a/debian/patches/battery_acpi_complain.dpatch b/debian/patches/battery_acpi_complain.dpatch deleted file mode 100755 index 7ed6042..0000000 --- a/debian/patches/battery_acpi_complain.dpatch +++ /dev/null @@ -1,50 +0,0 @@ -#! /bin/sh /usr/share/dpatch/dpatch-run -## battery_acpi_complain.dpatch by Sebastian Harl -## -## DP: battery plugin: Don't complain about missing /proc/acpi/battery each -## DP: interval. Instead, complain once when the read callback is called for -## DP: the first time. - -@DPATCH@ - -diff a/src/battery.c b/src/battery.c ---- a/src/battery.c -+++ b/src/battery.c -@@ -23,6 +23,8 @@ - #include "common.h" - #include "plugin.h" - -+#include "utils_complain.h" -+ - #if HAVE_MACH_MACH_TYPES_H - # include - #endif -@@ -436,6 +438,8 @@ static int battery_read (void) - /* #endif HAVE_IOKIT_IOKITLIB_H || HAVE_IOKIT_PS_IOPOWERSOURCES_H */ - - #elif KERNEL_LINUX -+ static c_complain_t acpi_dir_complaint = C_COMPLAIN_INIT_STATIC; -+ - FILE *fh; - char buffer[1024]; - char filename[256]; -@@ -506,8 +510,17 @@ static int battery_read (void) - battery_submit ("0", "voltage", voltage); - } - -- walk_directory (battery_acpi_dir, battery_read_acpi, -- /* user_data = */ NULL); -+ if (0 == access (battery_acpi_dir, R_OK)) -+ walk_directory (battery_acpi_dir, battery_read_acpi, -+ /* user_data = */ NULL); -+ else -+ { -+ char errbuf[1024]; -+ c_complain_once (LOG_WARNING, &acpi_dir_complaint, -+ "battery plugin: Failed to access `%s': %s", -+ battery_acpi_dir, -+ sstrerror (errno, errbuf, sizeof (errbuf))); -+ } - - #endif /* KERNEL_LINUX */ -