From fe7552a4e73e55655d44903ea7f9fd053029e2f9 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Wed, 18 Feb 2009 23:39:57 +0100 Subject: [PATCH] java plugin: Divide times received from Java by 1000. Java keeps time as milliseconds in 64bit integers. Let's keep it that way and translate to epoch transparently. The other way around, from C to Java, already multiplies by 1000. --- src/java.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/java.c b/src/java.c index 2d4974f2..488e18bd 100644 --- a/src/java.c +++ b/src/java.c @@ -1078,7 +1078,8 @@ static int jtoc_value_list (JNIEnv *jvm_env, value_list_t *vl, /* {{{ */ ERROR ("java plugin: jtoc_value_list: jtoc_long (getTime) failed."); return (-1); } - vl->time = (time_t) tmp_long; + /* Java measures time in milliseconds. */ + vl->time = (time_t) (tmp_long / ((jlong) 1000)); status = jtoc_long (jvm_env, &tmp_long, class_ptr, object_ptr, "getInterval"); -- 2.11.0