projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'collectd-4.10' into collectd-5.0
[collectd.git]
/
src
/
java.c
diff --git
a/src/java.c
b/src/java.c
index
4d490eb
..
b69ca94
100644
(file)
--- a/
src/java.c
+++ b/
src/java.c
@@
-819,7
+819,8
@@
static jobject ctoj_value_list (JNIEnv *jvm_env, /* {{{ */
}
/* Set the `interval' member.. */
}
/* Set the `interval' member.. */
- status = ctoj_long (jvm_env, (jlong) vl->interval,
+ status = ctoj_long (jvm_env,
+ (jlong) CDTIME_T_TO_MS (vl->interval),
c_valuelist, o_valuelist, "setInterval");
if (status != 0)
{
c_valuelist, o_valuelist, "setInterval");
if (status != 0)
{
@@
-914,7
+915,7
@@
static jobject ctoj_notification (JNIEnv *jvm_env, /* {{{ */
return (NULL);
}
return (NULL);
}
- /* Set the `
interval
' member.. */
+ /* Set the `
severity
' member.. */
status = ctoj_int (jvm_env, (jint) n->severity,
c_notification, o_notification, "setSeverity");
if (status != 0)
status = ctoj_int (jvm_env, (jint) n->severity,
c_notification, o_notification, "setSeverity");
if (status != 0)
@@
-1242,7
+1243,7
@@
static int jtoc_value_list (JNIEnv *jvm_env, value_list_t *vl, /* {{{ */
return (-1);
}
/* Java measures time in milliseconds. */
return (-1);
}
/* Java measures time in milliseconds. */
- vl->time =
(time_t) (tmp_long / ((jlong) 1000)
);
+ vl->time =
MS_TO_CDTIME_T (tmp_long
);
status = jtoc_long (jvm_env, &tmp_long,
class_ptr, object_ptr, "getInterval");
status = jtoc_long (jvm_env, &tmp_long,
class_ptr, object_ptr, "getInterval");
@@
-1251,7
+1252,7
@@
static int jtoc_value_list (JNIEnv *jvm_env, value_list_t *vl, /* {{{ */
ERROR ("java plugin: jtoc_value_list: jtoc_long (getInterval) failed.");
return (-1);
}
ERROR ("java plugin: jtoc_value_list: jtoc_long (getInterval) failed.");
return (-1);
}
- vl->interval =
(int) tmp_long
;
+ vl->interval =
MS_TO_CDTIME_T (tmp_long)
;
status = jtoc_values_array (jvm_env, ds, vl, class_ptr, object_ptr);
if (status != 0)
status = jtoc_values_array (jvm_env, ds, vl, class_ptr, object_ptr);
if (status != 0)
@@
-1931,7
+1932,9
@@
static int cjni_init_native (JNIEnv *jvm_env) /* {{{ */
api_class_ptr = (*jvm_env)->FindClass (jvm_env, "org/collectd/api/Collectd");
if (api_class_ptr == NULL)
{
api_class_ptr = (*jvm_env)->FindClass (jvm_env, "org/collectd/api/Collectd");
if (api_class_ptr == NULL)
{
- ERROR ("cjni_init_native: Cannot find API class `org/collectd/api/Collectd'.");
+ ERROR ("cjni_init_native: Cannot find the API class \"org.collectd.api"
+ ".Collectd\". Please set the correct class path "
+ "using 'JVMArg \"-Djava.class.path=...\"'.");
return (-1);
}
return (-1);
}
@@
-2253,7
+2256,6
@@
static int cjni_config_plugin_block (oconfig_item_t *ci) /* {{{ */
cjni_callback_info_t *cbi;
jobject o_ocitem;
const char *name;
cjni_callback_info_t *cbi;
jobject o_ocitem;
const char *name;
- int status;
size_t i;
jclass class;
size_t i;
jclass class;
@@
-2308,7
+2310,7
@@
static int cjni_config_plugin_block (oconfig_item_t *ci) /* {{{ */
method = (*jvm_env)->GetMethodID (jvm_env, class,
"config", "(Lorg/collectd/api/OConfigItem;)I");
method = (*jvm_env)->GetMethodID (jvm_env, class,
"config", "(Lorg/collectd/api/OConfigItem;)I");
-
status =
(*jvm_env)->CallIntMethod (jvm_env,
+ (*jvm_env)->CallIntMethod (jvm_env,
cbi->object, method, o_ocitem);
(*jvm_env)->DeleteLocalRef (jvm_env, o_ocitem);
cbi->object, method, o_ocitem);
(*jvm_env)->DeleteLocalRef (jvm_env, o_ocitem);
@@
-3077,9
+3079,8
@@
static int cjni_init (void) /* {{{ */
if (config_block != NULL)
{
if (config_block != NULL)
{
- int status;
-
status =
cjni_config_perform (config_block);
+ cjni_config_perform (config_block);
oconfig_free (config_block);
config_block = NULL;
}
oconfig_free (config_block);
config_block = NULL;
}