From: Sebastian Harl Date: Wed, 17 Sep 2008 18:10:39 +0000 (+0200) Subject: Added debian/patches/memcached_timeout.dpatch. X-Git-Tag: collectd-4.4.2-2~4 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=47fc3d0a153c28ea235bb2decb19aa3ce89bd748;p=pkg-collectd.git Added debian/patches/memcached_timeout.dpatch. Trivial upstream patch to fix the timeout passed to poll(2). --- diff --git a/debian/changelog b/debian/changelog index 1f60063..97ca2b4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -12,8 +12,10 @@ collectd (4.4.2-2) unstable; urgency=low possible memory leak in the snmp plugin. * Added debian/patches/memcached_fdleak.dpatch - trivial upstream patch to fix a possible file descriptor leak in the memcached plugin. + * Added debian/patches/memcached_timeout.dpatch - trivial upstream patch to + fix the timeout passed to poll(2). - -- Sebastian Harl Wed, 17 Sep 2008 19:29:55 +0200 + -- Sebastian Harl Wed, 17 Sep 2008 20:08:55 +0200 collectd (4.4.2-1) unstable; urgency=low diff --git a/debian/patches/00list b/debian/patches/00list index 3a38f12..c72403e 100644 --- a/debian/patches/00list +++ b/debian/patches/00list @@ -5,4 +5,5 @@ memory_libstatgrab.dpatch collectd_memleak.dpatch snmp_memleak.dpatch memcached_fdleak.dpatch +memcached_timeout.dpatch diff --git a/debian/patches/memcached_timeout.dpatch b/debian/patches/memcached_timeout.dpatch new file mode 100755 index 0000000..113cd74 --- /dev/null +++ b/debian/patches/memcached_timeout.dpatch @@ -0,0 +1,22 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## memcached_timeout.dpatch by Florian Forster +## +## DP: memcached plugin: Wait for a *little* longer for memcached to answer: +## DP: poll(2) takes a timeout in milliseconds, not seconds. Also, use the +## DP: global interval instead of some random number as timeout. +## DP: (This is upstream Git commit 801067164e6eb068f5b5b2c45638fd207d5084ff) + +@DPATCH@ + +diff a/src/memcached.c b/src/memcached.c +--- a/src/memcached.c ++++ b/src/memcached.c +@@ -134,7 +134,7 @@ static int memcached_query_daemon (char *buffer, int buffer_size) /* {{{ */ + p.events = POLLIN|POLLERR|POLLHUP; + p.revents = 0; + +- n = poll(&p, 1, 3); ++ n = poll(&p, 1, 1000 * interval_g); + + if (n <= 0) { + ERROR ("memcached: poll() failed or timed out");