summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6344e5a)
raw | patch | inline | side by side (parent: 6344e5a)
author | Sebastian Harl <sh@tokkee.org> | |
Wed, 8 Sep 2010 20:37:45 +0000 (22:37 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Wed, 8 Sep 2010 20:37:45 +0000 (22:37 +0200) |
This is an upstream patch fixing the 'reheap()' function used to manage the
"read" callbacks and making sure all plugins get executed correctly and in
each interval.
Closes: #596128
"read" callbacks and making sure all plugins get executed correctly and in
each interval.
Closes: #596128
debian/changelog | patch | blob | history | |
debian/patches/00list | patch | blob | history | |
debian/patches/bts596128-reheap-fix.dpatch | [new file with mode: 0755] | patch | blob |
diff --git a/debian/changelog b/debian/changelog
index c220dd808bd13fa7b1e3c4c1a4ad6b8cbb584eb2..42d43bba944f68f96f8aa074f803e18c0e96381f 100644 (file)
--- a/debian/changelog
+++ b/debian/changelog
- Added bts592623-curl_json-file -- upstream patch fixing access to
file:// URLs in the 'curl_json' plugin; thanks Baptiste Mille-Mathias
for reporting this and pointing out the patch (Closes: #592623).
+ - Added bts596128-reheap-fix -- upstream patch fixing the 'reheap()'
+ function used to manage the "read" callbacks and making sure all plugins
+ get executed correctly and in each interval (Closes: #596128).
- -- Sebastian Harl <tokkee@debian.org> Wed, 08 Sep 2010 22:25:05 +0200
+ -- Sebastian Harl <tokkee@debian.org> Wed, 08 Sep 2010 22:35:38 +0200
collectd (4.10.1-1) unstable; urgency=low
diff --git a/debian/patches/00list b/debian/patches/00list
index e186cd0a396ef3f3782a9821a7151eb9e3309f0c..e7a35f8a0317ce3ff8d21dc05589b55f93c0bed5 100644 (file)
--- a/debian/patches/00list
+++ b/debian/patches/00list
bts559801_plugin_find_fix.dpatch
bts595756-notify_email-segfault.dpatch
bts592623-curl_json-file.dpatch
+bts596128-reheap-fix.dpatch
diff --git a/debian/patches/bts596128-reheap-fix.dpatch b/debian/patches/bts596128-reheap-fix.dpatch
--- /dev/null
@@ -0,0 +1,46 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## bts596128-reheap-fix.dpatch by Florian Forster <octo@verplant.org>
+##
+## DP: src/utils_heap.c: Fix calculation of the parent's index.
+## DP:
+## DP: This resulted in the "upwards" reheap function to return prematurely,
+## DP: leaving the heap condition violated.
+
+@DPATCH@
+
+diff a/src/utils_heap.c b/src/utils_heap.c
+--- a/src/utils_heap.c
++++ b/src/utils_heap.c
+@@ -96,7 +96,7 @@ static void reheap (c_heap_t *h, size_t root, enum reheap_direction dir)
+ return;
+
+ if (dir == DIR_UP)
+- reheap (h, root / 2, dir);
++ reheap (h, (root - 1) / 2, dir);
+ else if (dir == DIR_DOWN)
+ reheap (h, min, dir);
+ } /* void reheap */
+@@ -140,6 +140,8 @@ void c_heap_destroy (c_heap_t *h)
+
+ int c_heap_insert (c_heap_t *h, void *ptr)
+ {
++ size_t index;
++
+ if ((h == NULL) || (ptr == NULL))
+ return (-EINVAL);
+
+@@ -162,11 +164,12 @@ int c_heap_insert (c_heap_t *h, void *ptr)
+ }
+
+ /* Insert the new node as a leaf. */
+- h->list[h->list_len] = ptr;
++ index = h->list_len;
++ h->list[index] = ptr;
+ h->list_len++;
+
+ /* Reorganize the heap from bottom up. */
+- reheap (h, /* parent of this node = */ (h->list_len - 1) / 2, DIR_UP);
++ reheap (h, /* parent of this node = */ (index - 1) / 2, DIR_UP);
+
+ pthread_mutex_unlock (&h->lock);
+ return (0);