summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a125a18)
raw | patch | inline | side by side (parent: a125a18)
author | Sebastian Harl <sh@tokkee.org> | |
Sun, 11 Oct 2009 17:18:45 +0000 (19:18 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Sun, 11 Oct 2009 17:18:45 +0000 (19:18 +0200) |
This patch has been included upstream.
debian/changelog | patch | blob | history | |
debian/patches/00list | patch | blob | history | |
debian/patches/java-fix-jvm-start.dpatch | [deleted file] | patch | blob | history |
diff --git a/debian/changelog b/debian/changelog
index 52a71a54e85549db4953f7112d641079f9956a55..378e5fd32760fa9e5b97c7a8f82a5ebca0d19dd7 100644 (file)
--- a/debian/changelog
+++ b/debian/changelog
- Removed bts535787-powerdns-fix-localsocket.dpatch - included upstream.
- Removed bts541953-curl-followlocation.dpatch - included upstream.
- Removed bts542859-df-fix-ignorelist.dpatch - included upstream.
+ - Removed java-fix-jvm-start.dpatch - included upstream.
- -- Sebastian Harl <tokkee@debian.org> Sun, 11 Oct 2009 19:15:33 +0200
+ -- Sebastian Harl <tokkee@debian.org> Sun, 11 Oct 2009 19:18:29 +0200
collectd (4.7.2-1) unstable; urgency=low
diff --git a/debian/patches/00list b/debian/patches/00list
index 7297c986cedfaceb709d43dd4d12529dd9a0f2dc..680577af72672f31d87a1d7941321ca211713c54 100644 (file)
--- a/debian/patches/00list
+++ b/debian/patches/00list
network-fix-cacheflush.dpatch
libvirt-reconnect.dpatch
plugin-fix-unregister.dpatch
-java-fix-jvm-start.dpatch
diff --git a/debian/patches/java-fix-jvm-start.dpatch b/debian/patches/java-fix-jvm-start.dpatch
+++ /dev/null
@@ -1,127 +0,0 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## java-fix-jvm-start.dpatch by Florian Forster <octo@verplant.org>
-##
-## DP: java plugin: Wait with the configuration until the daemon has forked.
-## DP
-## DP: Passing the configuration to Java-based plugins requires the JVM to be
-## DP: active and running. However, the JVM starts some threads that are lost
-## DP: when the daemon forks to the background.
-## DP:
-## DP: This patch changes the behavior of the Java plugin to copy the
-## DP: configuration blocks found to a local variable and run the configuration
-## DP: of the Java-based plugins from the `init' callback, because it is
-## DP: invoked after the daemon has forked to the background.
-
-@DPATCH@
-
-diff a/src/java.c b/src/java.c
---- a/src/java.c
-+++ b/src/java.c
-@@ -93,6 +93,8 @@ static cjni_callback_info_t *java_callbacks = NULL;
- static size_t java_callbacks_num = 0;
- static pthread_mutex_t java_callbacks_lock = PTHREAD_MUTEX_INITIALIZER;
-
-+static oconfig_item_t *config_block = NULL;
-+
- /*
- * Prototypes
- *
-@@ -2304,7 +2306,7 @@ static int cjni_config_plugin_block (oconfig_item_t *ci) /* {{{ */
- return (0);
- } /* }}} int cjni_config_plugin_block */
-
--static int cjni_config (oconfig_item_t *ci) /* {{{ */
-+static int cjni_config_perform (oconfig_item_t *ci) /* {{{ */
- {
- int success;
- int errors;
-@@ -2359,7 +2361,56 @@ static int cjni_config (oconfig_item_t *ci) /* {{{ */
- }
-
- return (0);
--} /* }}} int cjni_config */
-+} /* }}} int cjni_config_perform */
-+
-+/* Copy the children of `ci' to the global `config_block' variable. */
-+static int cjni_config_callback (oconfig_item_t *ci) /* {{{ */
-+{
-+ oconfig_item_t *ci_copy;
-+ oconfig_item_t *tmp;
-+
-+ assert (ci != NULL);
-+ if (ci->children_num == 0)
-+ return (0); /* nothing to do */
-+
-+ ci_copy = oconfig_clone (ci);
-+ if (ci_copy == NULL)
-+ {
-+ ERROR ("java plugin: oconfig_clone failed.");
-+ return (-1);
-+ }
-+
-+ if (config_block == NULL)
-+ {
-+ config_block = ci_copy;
-+ return (0);
-+ }
-+
-+ tmp = realloc (config_block->children,
-+ (config_block->children_num + ci_copy->children_num) * sizeof (*tmp));
-+ if (tmp == NULL)
-+ {
-+ ERROR ("java plugin: realloc failed.");
-+ oconfig_free (ci_copy);
-+ return (-1);
-+ }
-+ config_block->children = tmp;
-+
-+ /* Copy the pointers */
-+ memcpy (config_block->children + config_block->children_num,
-+ ci_copy->children,
-+ ci_copy->children_num * sizeof (*ci_copy->children));
-+ config_block->children_num += ci_copy->children_num;
-+
-+ /* Delete the pointers from the copy, so `oconfig_free' can't free them. */
-+ memset (ci_copy->children, 0,
-+ ci_copy->children_num * sizeof (*ci_copy->children));
-+ ci_copy->children_num = 0;
-+
-+ oconfig_free (ci_copy);
-+
-+ return (0);
-+} /* }}} int cjni_config_callback */
-
- /* Free the data contained in the `user_data_t' pointer passed to `cjni_read'
- * and `cjni_write'. In particular, delete the global reference to the Java
-@@ -2995,6 +3046,22 @@ static int cjni_init (void) /* {{{ */
- {
- JNIEnv *jvm_env;
-
-+ if ((config_block == NULL) && (jvm == NULL))
-+ {
-+ ERROR ("java plugin: cjni_init: No configuration block for "
-+ "the java plugin was found.");
-+ return (-1);
-+ }
-+
-+ if (config_block != NULL)
-+ {
-+ int status;
-+
-+ status = cjni_config_perform (config_block);
-+ oconfig_free (config_block);
-+ config_block = NULL;
-+ }
-+
- if (jvm == NULL)
- {
- ERROR ("java plugin: cjni_init: jvm == NULL");
-@@ -3013,7 +3080,7 @@ static int cjni_init (void) /* {{{ */
-
- void module_register (void)
- {
-- plugin_register_complex_config ("java", cjni_config);
-+ plugin_register_complex_config ("java", cjni_config_callback);
- plugin_register_init ("java", cjni_init);
- plugin_register_shutdown ("java", cjni_shutdown);
- } /* void module_register (void) */